postmark 1.22.3 → 1.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +3 -0
- data/VERSION +1 -1
- data/lib/postmark/error.rb +5 -4
- data/lib/postmark/version.rb +1 -1
- data/spec/unit/postmark/error_spec.rb +12 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfce0fc58365a91800f896d2d16c8d62d1a601f7a1a8d5350c6270cae3f12be3
|
4
|
+
data.tar.gz: 3d8b2761c884f6ca1f3c81efe7c30dda1432b6d7da740d18d6cc55f5cc062d23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4082d74e41c4d74378f4e46bb43d0b8dd967489125865cd9379fbc3928dfd0be7369408cfcdcc6a979822739b8734045fba8a66021591848dff801286ef183d9
|
7
|
+
data.tar.gz: 5c93b937e1749584f52c1a1f5e0a4a9eabc6ea579e02c26f20d709ea5b89873d666acd6b8c2e7733a5e18885df370c1f2ca26e9c96c23cc44448d95c4f0da309
|
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.23.0
|
data/lib/postmark/error.rb
CHANGED
@@ -43,7 +43,7 @@ module Postmark
|
|
43
43
|
|
44
44
|
class ApiInputError < HttpServerError
|
45
45
|
INACTIVE_RECIPIENT = 406
|
46
|
-
|
46
|
+
INVALID_EMAIL_REQUEST = 300
|
47
47
|
|
48
48
|
attr_accessor :error_code
|
49
49
|
|
@@ -53,8 +53,8 @@ module Postmark
|
|
53
53
|
case error_code
|
54
54
|
when INACTIVE_RECIPIENT
|
55
55
|
InactiveRecipientError.new(error_code, body, parsed_body)
|
56
|
-
when
|
57
|
-
|
56
|
+
when INVALID_EMAIL_REQUEST
|
57
|
+
InvalidEmailRequestError.new(error_code, body, parsed_body)
|
58
58
|
else
|
59
59
|
new(error_code, body, parsed_body)
|
60
60
|
end
|
@@ -70,7 +70,7 @@ module Postmark
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
class
|
73
|
+
class InvalidEmailRequestError < ApiInputError; end
|
74
74
|
|
75
75
|
class InactiveRecipientError < ApiInputError
|
76
76
|
attr_reader :recipients
|
@@ -129,4 +129,5 @@ module Postmark
|
|
129
129
|
DeliveryError = Error
|
130
130
|
InvalidMessageError = ApiInputError
|
131
131
|
UnknownError = UnexpectedHttpResponseError
|
132
|
+
InvalidEmailAddressError = InvalidEmailRequestError
|
132
133
|
end
|
data/lib/postmark/version.rb
CHANGED
@@ -98,9 +98,9 @@ describe(Postmark::ApiInputError) do
|
|
98
98
|
end
|
99
99
|
|
100
100
|
context '300' do
|
101
|
-
let(:code) {Postmark::ApiInputError::
|
101
|
+
let(:code) {Postmark::ApiInputError::INVALID_EMAIL_REQUEST}
|
102
102
|
|
103
|
-
it {is_expected.to be_a(Postmark::
|
103
|
+
it {is_expected.to be_a(Postmark::InvalidEmailRequestError)}
|
104
104
|
it_behaves_like 'api input error'
|
105
105
|
end
|
106
106
|
|
@@ -149,13 +149,13 @@ describe(Postmark::MailAdapterError) do
|
|
149
149
|
it {is_expected.to be_a(Postmark::Error)}
|
150
150
|
end
|
151
151
|
|
152
|
-
describe(Postmark::
|
152
|
+
describe(Postmark::InvalidEmailRequestError) do
|
153
153
|
describe '.new' do
|
154
154
|
let(:response) {{'Message' => message}}
|
155
155
|
|
156
156
|
subject do
|
157
|
-
Postmark::
|
158
|
-
Postmark::ApiInputError::
|
157
|
+
Postmark::InvalidEmailRequestError.new(
|
158
|
+
Postmark::ApiInputError::INVALID_EMAIL_REQUEST, Postmark::Json.encode(response), response)
|
159
159
|
end
|
160
160
|
|
161
161
|
let(:message) do
|
@@ -171,7 +171,7 @@ describe(Postmark::InvalidEmailAddressError) do
|
|
171
171
|
end
|
172
172
|
|
173
173
|
it 'error code is set' do
|
174
|
-
expect(subject.error_code).to eq(Postmark::ApiInputError::
|
174
|
+
expect(subject.error_code).to eq(Postmark::ApiInputError::INVALID_EMAIL_REQUEST)
|
175
175
|
end
|
176
176
|
end
|
177
177
|
end
|
@@ -274,3 +274,9 @@ describe(Postmark::UnknownError) do
|
|
274
274
|
expect(subject.class).to eq(Postmark::UnexpectedHttpResponseError)
|
275
275
|
end
|
276
276
|
end
|
277
|
+
|
278
|
+
describe(Postmark::InvalidEmailAddressError) do
|
279
|
+
it 'is an alias for backwards compatibility' do
|
280
|
+
expect(subject.class).to eq(Postmark::InvalidEmailRequestError)
|
281
|
+
end
|
282
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomek Maszkowski
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2023-01-
|
16
|
+
date: 2023-01-23 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: json
|