Catch all exceptions in autogpt (#3413)

Ought to be more autonomous
fix_agent_callbacks
Zander Chase 1 year ago committed by GitHub
parent 738ee56b86
commit 3d8243ec95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -110,7 +110,13 @@ class AutoGPT:
try:
observation = tool.run(action.args)
except ValidationError as e:
observation = f"Error in args: {str(e)}"
observation = (
f"Validation Error in args: {str(e)}, args: {action.args}"
)
except Exception as e:
observation = (
f"Error: {str(e)}, {type(e).__name__}, args: {action.args}"
)
result = f"Command {tool.name} returned: {observation}"
elif action.name == "ERROR":
result = f"Error: {action.args}. "

Loading…
Cancel
Save