Skip to content

[ENHANCEMENT] Add centralized error response handling using global exception handlers#396

Open
Lochit-Vinay wants to merge 4 commits intofireform-core:mainfrom
Lochit-Vinay:centralized-error-handling
Open

[ENHANCEMENT] Add centralized error response handling using global exception handlers#396
Lochit-Vinay wants to merge 4 commits intofireform-core:mainfrom
Lochit-Vinay:centralized-error-handling

Conversation

@Lochit-Vinay
Copy link
Copy Markdown

Summary

This PR introduces centralized error handling across the API by adding global exception handlers in FastAPI.

Changes Made

  • Added global handler for HTTPException
  • Added handler for RequestValidationError
  • Added catch-all exception handler for unexpected errors
  • Standardized error response format across endpoints

Example Response

{
"error": {
"type": "ValidationError",
"message": "Invalid request data",
"details": [...]
}
}

Why this is useful

  • Ensures consistent API responses
  • Improves debugging and error handling
  • Simplifies frontend integration

Tested locally after installing dependencies from requirements.txt.

Closes #394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Add centralized error response format for all API endpoints

1 participant