| 158 | |
| 159 | |
| 160 | class SchemaTypeValidationError(InvalidCallbackReturnValue): |
| 161 | def __init__(self, value, full_schema, path, expected_type): |
| 162 | super().__init__( |
| 163 | msg=f""" |
| 164 | Schema: {full_schema} |
| 165 | Path: {repr(path)} |
| 166 | Expected type: {expected_type} |
| 167 | Received value of type {type(value)}: |
| 168 | {repr(value)} |
| 169 | """ |
| 170 | ) |
| 171 | |
| 172 | @classmethod |
| 173 | def check(cls, value, full_schema, path, expected_type): |
| 174 | if not isinstance(value, expected_type): |
| 175 | raise SchemaTypeValidationError(value, full_schema, path, expected_type) |
| 176 | |
| 177 | |
| 178 | class SchemaLengthValidationError(InvalidCallbackReturnValue): |
no outgoing calls
no test coverage detected
searching dependent graphs…