MCPcopy
hub / github.com/pydantic/pydantic / ErrorWrapper

Class ErrorWrapper

pydantic/v1/error_wrappers.py:28–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28class ErrorWrapper(Representation):
29 __slots__ = 'exc', '_loc'
30
31 def __init__(self, exc: Exception, loc: Union[str, 'Loc']) -> None:
32 self.exc = exc
33 self._loc = loc
34
35 def loc_tuple(self) -> 'Loc':
36 if isinstance(self._loc, tuple):
37 return self._loc
38 else:
39 return (self._loc,)
40
41 def __repr_args__(self) -> 'ReprArgs':
42 return [('exc', self.exc), ('loc', self.loc_tuple())]
43
44
45# ErrorList is something like Union[List[Union[List[ErrorWrapper], ErrorWrapper]], ErrorWrapper]

Callers 11

validateMethod · 0.90
_validate_iterableMethod · 0.90
_validate_tupleMethod · 0.90
_apply_validatorsMethod · 0.90
__setattr__Method · 0.90
parse_objMethod · 0.90
parse_rawMethod · 0.90
validate_modelFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected