[英]What mail service errors can AppEngine produce?
我想控制我的send()
調用並將其嵌入try / except中,但是我不確定它會產生什么錯誤。
環顧SDK,似乎MailServiceError是其中一個,但不確定,因為我不知道如何測試這樣的錯誤。
有人可以確認嗎?
調用send()可能會引發以下異常: https : //developers.google.com/appengine/docs/python/mail/exceptions
以下是如何捕獲這些錯誤的示例:
from google3.apphosting.api import mail
# other code to create 'message' here
try:
message.send()
except mail.InvalidSender, e:
# Do something special for an invalid sender error
pass
except mail.Error, e:
# This will catch all the other exceptions in the doc above.
pass
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.