🐛 Unhandled Exception in POST /templates/create
name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: POST /templates/create leaks FileNotFoundError as 500"
labels: bug
assignees: ''
⚡️ Describe the Bug
If the client supplies a non-existent pdf_path, commonforms.prepare_form() raises FileNotFoundError.
No try/except exists in the route handler, so FastAPI returns:
- 500 Internal Server Error
- Generic response body
- Full traceback logged
📉 Expected Behavior
- Return 404 with meaningful message for bad path
- Return 422 for generic processing errors
- Structured JSON via AppError
🕵️ Possible Fix
Wrap controller call in try/except:
- Catch FileNotFoundError → AppError 404
- Catch generic Exception → AppError 422
🐛 Unhandled Exception in POST /templates/create
name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: POST /templates/create leaks FileNotFoundError as 500"
labels: bug
assignees: ''
⚡️ Describe the Bug
If the client supplies a non-existent
pdf_path,commonforms.prepare_form()raisesFileNotFoundError.No try/except exists in the route handler, so FastAPI returns:
📉 Expected Behavior
🕵️ Possible Fix
Wrap controller call in try/except: