Exception: Postmark::InactiveRecipientError
- Inherits:
-
ApiInputError
- Object
- StandardError
- Error
- HttpServerError
- ApiInputError
- Postmark::InactiveRecipientError
- Defined in:
- lib/postmark/error.rb
Constant Summary collapse
- PATTERNS =
[ /Found inactive addresses: (.+?)\. Inactive/, /these inactive addresses: (.+?)\.?$/ ].freeze
Constants inherited from ApiInputError
ApiInputError::INACTIVE_RECIPIENT, ApiInputError::INVALID_EMAIL_REQUEST
Instance Attribute Summary collapse
-
#recipients ⇒ Object
readonly
Returns the value of attribute recipients.
Attributes inherited from ApiInputError
Attributes inherited from HttpServerError
#body, #parsed_body, #status_code
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ InactiveRecipientError
constructor
A new instance of InactiveRecipientError.
Methods inherited from ApiInputError
Methods inherited from HttpServerError
Constructor Details
#initialize(*args) ⇒ InactiveRecipientError
Returns a new instance of InactiveRecipientError.
95 96 97 98 |
# File 'lib/postmark/error.rb', line 95 def initialize(*args) super @recipients = parse_recipients || [] end |
Instance Attribute Details
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
78 79 80 |
# File 'lib/postmark/error.rb', line 78 def recipients @recipients end |
Class Method Details
.parse_recipients(message) ⇒ Object
85 86 87 88 89 90 91 92 93 |
# File 'lib/postmark/error.rb', line 85 def self.parse_recipients() PATTERNS.each do |p| _, recipients = p.match().to_a next unless recipients return recipients.split(', ') end [] end |