fix: Fix serialization error caused by ignored field in ErrorInfo object

- Change `ErrorInfo` class attribute `_repr` to `repr` for consistent serialization
- Update `__repr__` method to return `self.repr` instead of `self._repr`
This commit is contained in:
Reinier van der Leer
2023-10-30 16:09:50 -07:00
parent fc1d73ba60
commit 653fc5851d

View File

@@ -30,7 +30,7 @@ class ErrorInfo(BaseModel):
args: tuple
message: str
exception_type: str
_repr: str
repr: str
@staticmethod
def from_exception(exception: Exception) -> ErrorInfo:
@@ -38,14 +38,14 @@ class ErrorInfo(BaseModel):
args=exception.args,
message=getattr(exception, "message", exception.args[0]),
exception_type=exception.__class__.__name__,
_repr=repr(exception),
repr=repr(exception),
)
def __str__(self):
return repr(self)
def __repr__(self):
return self._repr
return self.repr
class ActionErrorResult(BaseModel):