Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/core/ydata/core/error/fabric_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def _camelcased(value: str) -> str:
return capitalized[0].lower() + capitalized[1:]


# pylint: disable=too-many-arguments
# pylint: disable=too-many-arguments, import-outside-toplevel
class FabricError(Exception):
context: dict[str, str] | None
description: str
Expand Down Expand Up @@ -43,14 +43,16 @@ def __iter__(self):
"return_value": self.return_value
}.items()

def __str__(self) -> str:
return f'''
{self.__class__.__name__}(name={self.name}, context={self.context}, description={self.description}, \
http_code={self.http_code}, return_value={self.return_value})
'''

def __repr__(self) -> str:
return self.__str__()
from pprint import pformat
return f"{self.__class__.__name__}(\n{pformat(dict(self), width=120, sort_dicts=False)}\n)"

def __str__(self) -> str:
from pprint import pformat
string = f"{self.name} - {self.description}"
if self.context:
string += f"\ncontext: {pformat(self.context, width=160, sort_dicts=False)}"
return string

def __sizeof__(self) -> int:
context_size = getsizeof(self.context) if self.context else 0
Expand Down