def internal_server_error(e): """ Return a custom message for a 500 internal error :param e: Exception :return: """ return response('failed', 'Internal server error', 500)
def route_not_found(e): """ Return a custom 404 Http response message for missing or not found routes. :param e: Exception :return: Http Response """ return response('failed', 'Endpoint not found', 404)
def services_down(e): """ Custom response to 503 errors. :param e: :return: """ return response('down', 'Services down', 503)
def bad_method(e): """ Custom response to 400 errors. :param e: :return: """ return response('failed', 'Bad request', 400)
def item_not_found(e): """ Custom response to 404 errors. :param e: :return: """ return response('failed', 'Item not found', 404)
def method_not_found(e): """ Custom response for methods not allowed for the requested URLs :param e: Exception :return: """ return response('failed', 'The method is not allowed for the requested URL', 405)
def health_information(): """ This is used for things to check the health of the app. """ return response('up', 'Services up! Thanks for checking ', 200)