Register error handler for user defined exceptions first
Old version of Flask's errorhandler relies on registration order
instead of exception hierarchy, for example with old version of Flask,
NotFound exception will result in '400 BAD REQUEST' instead of
'404 NOT FOUND'.