Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GAE email me errors

Can GAE be configured to bust me an email when there's an error?

like image 729
bobobobo Avatar asked Jun 12 '26 02:06

bobobobo


1 Answers

I think the best you can do is to have in your main function some code like...:

try:
  ...normal body of your main goes here...
except:
  from google.appengine.api import mail
  import sys

  mail.send_mail(sender="Your GAE App <[email protected]>",
              to="You <[email protected]>",
              subject="GAE App error",
              body="""
Your App Engine app raised an exception:
  %s
""" % sys.exc_info()[:2])

(of course, you can do better formatting on the exception information, etc, etc).

like image 87
Alex Martelli Avatar answered Jun 13 '26 16:06

Alex Martelli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!