MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / add_exception_handlers

Function add_exception_handlers

utils/error_handler.py:134–147  ·  view source on GitHub ↗

Add exception handlers to FastAPI app.

(app)

Source from the content-addressed store, hash-verified

132
133
134def add_exception_handlers(app):
135 """Add exception handlers to FastAPI app."""
136 app.add_exception_handler(ValidationError, handle_validation_error)
137 app.add_exception_handler(SecurityError, handle_security_error)
138 app.add_exception_handler(ConfigurationError, handle_configuration_error)
139 app.add_exception_handler(WorkflowExecutionError, handle_workflow_execution_error)
140 app.add_exception_handler(ResourceNotFoundError, handle_resource_not_found_error)
141 app.add_exception_handler(ResourceConflictError, handle_resource_conflict_error)
142 app.add_exception_handler(TimeoutError, handle_timeout_error)
143 app.add_exception_handler(ExternalServiceError, handle_external_service_error)
144 app.add_exception_handler(MACException, handle_mac_exception)
145 app.add_exception_handler(Exception, handle_general_exception)
146
147 return app

Callers 1

init_appFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected