truemped/supercell — pull request #15 by hellp (2014-06-24 19:44:48+00:00)
Title: Custom error handling hook for RequestHandler._execute_method

This is a suggestion to make error handling that happens in `_execute_method` customizable in subclasses of `RequestHandler`.

My use case was that I wanted to have "nicer" JSON errors for model validation errors. The first solution was to create a subclass `class JsonRequestHandler(RequestHandler)` that overwrites the complete `_execute_method`. This turned out to be messy and a maintenance burden considering future upstream changes of `_execute_method`, so I though is hook-like approach may be feasible.

See docstring for an example.