-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thank you for the help.
I have one problem with the solution - it seems, that if there is custom error_handler in routes.py specified, the ticket is not being generated. No file with traceback information appears and also the request.vars.ticket is left undefined. David mdipierro napsal(a): > make app "error" with a controller default.py and an action > > def index(): > from gluon.tools import Mail > mail=Mail() > mail.settings.server="smpt.example.com:port" > mail.settings.sender="[email protected]" > mail.settings.login="you:password" > ticket=request.vars.ticket > subject="Ticket: %s" % ticket > message=bla bla bla > mail.sent > (to="[email protected]",subject=subject,message=message) > return "Sorry, an error occurred (%s), administrator has been > notified" % ticket > > and then create a file web2py/routes.py and in it write: > > error_handler = dict(application='error', controller='default', > function='index') > > > > > > On Sep 10, 8:54 am, David Zejda <[email protected]> wrote: > Hello, > > for a productive site I wish to touch the default error handler, maybe > using some kind of decorator. IMO it would be good to > > 1. retain the ticket generation > 2. notify admin by e-mail > 3. redirect client to a custom error page > > I would like to do it site-wide - not using the decorators for all > controller functions one-by-one. > > Please, I will appreciate your advices.. > > Thanks a lot! > > David > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkqqSHIACgkQ3oCkkciamVGu3wCfbo4iBpkj5Y2TrQ5hnu6ZDtYw +z4An2E+QK9lT+L7q+ZiAH6/bvudXfKG =66uR -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

