Example #1
0
def error_403(error):
    import random
    error_messages = [
        'You have just landed at area 51',
        'No, you cannot access this, Cowboy !!!',
        'Restricted, you must be 200 years old to access this page',
    ]
    message_index = random.randrange(0,len(error_messages))
    error_message = error_messages[message_index]
    data = {
       'error_title'  : '403, Forbidden',
       'error_message' : error_message,
    }
    return template('example/error', data = data)
Example #2
0
def error_500(error):
    import random
    error_messages = [
        'Something goes wrong',
        'No no no... Not again...',
        'Congratulation, you have just found an error !!!',
    ]
    message_index = random.randrange(0,len(error_messages))
    error_message = error_messages[message_index]
    data = {
       'error_title'  : '500, Internal Server Error',
       'error_message' : error_message,
    }
    return template('example/error', data = data)
Example #3
0
def error_404(error):
    import random
    error_messages = [
        'Sorry, but there is no gray elephant in Pacific',
        'Has you correctly write the URL?',
        'Go home you are drunk !!!',
    ]
    message_index = random.randrange(0,len(error_messages))
    error_message = error_messages[message_index]
    data = {
       'error_title'  : '404, Page not found',
       'error_message' : error_message,
    }
    return template('example/error', data = data)