Skip to content

[BUG]: Unhandled Exception in POST /templates/create #145

@Acuspeedster

Description

@Acuspeedster

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions