mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-02-07 15:24:31 +01:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user