Exemplo n.º 1
0
 def __init__(self, message: str, source: object, target: type,
              error: JSONDecodeError):
     """
     Constructor.
     :param message: the message of this error.
     :param source: the object that was to be deserialized.
     :param target: the type to which `source` was to be deserialized.
     :param error: the wrapped `JSONDecodeError`.
     """
     DeserializationError.__init__(self, message, source, target)
     JSONDecodeError.__init__(self, message, error.doc, error.pos)
Exemplo n.º 2
0
 def __init__(self, resp, exc):
     assert isinstance(exc, _JSONDecodeError)
     _JSONDecodeError.__init__(self, exc.msg, exc.doc, exc.pos)
     # exc.args[0] is errmsg created in JSONDecodeError.__init__
     DecodeError.__init__(self, resp, exc)