vial.errors module

This module contains error handling code for Vial application.

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

Generate error response in JSON format.

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

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

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

Generate error response in HTML format.

vial.errors.wants_json_response()[source]

Helper method for detecting prefered response in JSON format.