Raise (if report_all=False) or log (and return) a validation error.
(
msg: str, origin: Optional[ValueError] = None
)
| 39 | first_error_origin: Optional[ValueError] = None |
| 40 | |
| 41 | def raise_or_log_error( |
| 42 | msg: str, origin: Optional[ValueError] = None |
| 43 | ) -> ValueError: |
| 44 | """Raise (if report_all=False) or log (and return) a validation error.""" |
| 45 | if report_all: |
| 46 | logging.error(termcolor.colored(msg, 'red')) |
| 47 | return ValueError(msg) |
| 48 | else: |
| 49 | raise ValueError(msg) from origin |
| 50 | |
| 51 | for key, entry in ds.spec().items(): |
| 52 | if enforce_all_fields_required and not entry.required: |
no outgoing calls
no test coverage detected