hawat.errors module

This module contains error handling features for Hawat application.

hawat.errors.api_error_response(status_code, message=None, exception=None)[source]

Generate error response in JSON format.

hawat.errors.error_handler_switch(status_code, exc)[source]

Return correct error response (HTML or JSON) based on client preferences.

hawat.errors.error_response(status_code, message=None, exception=None)[source]

Generate error response in HTML format.

hawat.errors.wants_json_response()[source]

Helper method for detecting prefered response in JSON format.