Skip to content

Change generic error in deserialization #250

Closed as not planned
Closed as not planned

Description

@axelsrz

The deserialize_from_body method raises a generic ValueError for unsupported content types, but the route handlers don't catch and convert it to appropriate HTTP error responses. This will result in a 500 Internal Server Error instead of the more appropriate 415 Unsupported Media Type error. Consider either:

  1. Raising a framework-agnostic exception type that adapters can catch and convert to appropriate HTTP errors, or
  2. Documenting that framework-specific route handlers should wrap these calls with appropriate error handling.

Originally posted by @Copilot in #221 (comment)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions