Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display web2py errors directly (auto redirect to ticket)

Tags:

web2py

When developing a web2py application, its pretty normal to have various syntax errors, db issues and such.

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

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

like image 552
Tom Feiner Avatar asked Aug 17 '11 11:08

Tom Feiner


1 Answers

Try adding something like the following to your /web2py/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 details, see Routes on Error in the online book.

like image 84
Anthony Avatar answered Sep 24 '22 18:09

Anthony