How to display web2py errors directly (automatic redirection to a ticket)

When developing a web2py application, its a pretty normal way to have various syntax errors, problems with db, etc.

However, when debugging these problems (in a non-production system), a link to the ticket appears by default instead of the actual ticket.

Is there a way to automatically redirect to the actual ticket, eliminating the need for a click (and wait for the actual ticket to load)?

+5
source share
1 answer

Try adding something like the following to the / web 2py / routes.py file:

error_message_ticket='''
  <html><head>
    <script language="javascript">
      location.replace("/admin/default/ticket/%(ticket)s")
    </script>
    <!-- this is junk text else IE does not display the page: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //-->
  </head></html>'''

For more information, see Error Routes> in the online book.

+5
source

All Articles