Skip to content

How to write a custom error handler #1

Description

@cdruet

Great module. Very useful.

I'ld like to customise the handler for 500 to do a rollback. It should be available to all blueprints (in my case) but there could be a use for specifying which blueprints use this customised handler.

In the intro, you explicitly mention that:

Instead you can use your own response implementation passed as argument to ErrorHandler class: it must be a decorator and must take 3 args, a dict response, status code and dict headers.

Could you tell me a bit more about how to do that? Would you have a small example?

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions