Skip to content

Commit

Permalink
Debugging auth errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidEBest committed May 22, 2024
1 parent 79fe5b8 commit c155053
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dhrn-functions/packages/dhrn/sendmail/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ def main(args):
html=template.render(data=args),
category="Integration Test",
)
client = mt.MailtrapClient(token=MAILTRAP_API_TOKEN)
client.send(mail)
try:
client = mt.MailtrapClient(token=MAILTRAP_API_TOKEN)
client.send(mail)
except mt.exceptions.AuthorizationError as e:
# Handle the authorization error here
return {"error": "Mailtrap authorization error {MAILTRAP_API_TOKEN}"}

return {"body": args}

0 comments on commit c155053

Please sign in to comment.