diff --git a/serializable/__init__.py b/serializable/__init__.py index 54ce6a4..3fb6a1c 100644 --- a/serializable/__init__.py +++ b/serializable/__init__.py @@ -21,6 +21,7 @@ import inspect import json import logging +import os import re import typing # noqa: F401 import warnings @@ -299,7 +300,10 @@ def _from_json(cls: Type[_T], data: Dict[str, Any]) -> object: else: _data[k] = prop_info.concrete_type(v) except AttributeError as e: - logging.error(f'There was an AttributeError deserializing JSON to {cls} the Property {prop_info}: {e}') + logging.error(f'There was an AttributeError deserializing JSON to {cls}.{os.linesep}' + f'The Property is: {prop_info}{os.linesep}' + f'The Value was: {v}{os.linesep}' + f'Exception: {e}{os.linesep}') raise AttributeError( f'There was an AttributeError deserializing JSON to {cls} the Property {prop_info}: {e}' ) @@ -560,7 +564,10 @@ def _from_xml(cls: Type[_T], data: Union[TextIOWrapper, ElementTree.Element], else: _data[decoded_k] = prop_info.concrete_type(child_e.text) except AttributeError as e: - logging.error(f'There was an AttributeError deserializing XML to {cls} the Property {prop_info}: {e}') + logging.error(f'There was an AttributeError deserializing JSON to {cls}.{os.linesep}' + f'The Property is: {prop_info}{os.linesep}' + f'The Value was: {v}{os.linesep}' + f'Exception: {e}{os.linesep}') raise AttributeError( f'There was an AttributeError deserializing XML to {cls} the Property {prop_info}: {e}' )