Gae write me errors

Can GAE be configured to hurt my email on error?

+3
source share
2 answers

I think the best thing you can do is to have mainsome code in your function , for example ...:

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

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

(of course, you can better format information about exceptions, etc., etc.).

+4
source

Here is an example of using GAE to send email. You can build this example to catch exceptions and send an email to yourself ....

http://www.fishbonecloud.com/2010/11/automated-email-using-google-app-engine.html

0
source

Source: https://habr.com/ru/post/1729586/


All Articles