fix: error message issue when "exception.body" is None (#5464)
fix errormessage issue when "exception.body" is None Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
parent
039f80cb50
commit
a626209da6
1 changed files with 1 additions and 1 deletions
|
|
@ -381,7 +381,7 @@ class ErrorMessage(Message):
|
|||
exception = exception.__cause__
|
||||
# Get the error reason
|
||||
reason = f"**{exception.__class__.__name__}**\n"
|
||||
if hasattr(exception, "body") and "message" in exception.body:
|
||||
if hasattr(exception, "body") and isinstance(exception.body, dict) and "message" in exception.body:
|
||||
reason += f" - **{exception.body.get('message')}**\n"
|
||||
elif hasattr(exception, "code"):
|
||||
reason += f" - **Code: {exception.code}**\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue