Skip to content

Reduce HTTP awareness in non handler layers #66

@rentzso

Description

@rentzso

As a general rule, classes should fall into two distinct categories:

  • Classes that have functions named after HTTP verbs, and (basically) nothing else
  • Classes that don't know anything about HTTP verbs or protocol details

Rather than self.abort, raise a variety of typed exceptions. This would be a better, drop-in replacement for what self.abort does anyway. At the very top, and/or whichever layers are appropriate, catch typed exceptions and handle a JSON error return there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions