Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

made postmark exceptions subclasses of SMTPException

  • Loading branch information...
commit 15bc121b0d83d3894b041148ac6447978e38bfa6 1 parent c96c3af
@oraclebill oraclebill authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 postmark/core.py
View
7 postmark/core.py
@@ -765,13 +765,14 @@ def activate(self, bounce_id):
#
# Exceptions
+import smtplib
class PMMailMissingValueException(Exception):
def __init__(self, value):
self.parameter = value
def __str__(self):
return repr(self.parameter)
-class PMMailSendException(Exception):
+class PMMailSendException(smtplib.SMTPException):
'''
Base Postmark send exception
'''
@@ -781,13 +782,13 @@ def __init__(self, value, inner_exception=None):
def __str__(self):
return repr(self.parameter)
-class PMMailUnauthorizedException(PMMailSendException):
+class PMMailUnauthorizedException(smtplib.SMTPAuthenticationError):
'''
401: Unathorized sending due to bad API key
'''
pass
-class PMMailUnprocessableEntityException(PMMailSendException):
+class PMMailUnprocessableEntityException(smtplib.SMTPRecipientsRefused):
'''
422: Unprocessable Entity - usually an exception with either the sender
not having a matching Sender Signature in Postmark. Read the message
Please sign in to comment.
Something went wrong with that request. Please try again.