glia-errors 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/glia-errors.gemspec +1 -1
- data/lib/glia/errors/client_errors.rb +20 -0
- data/lib/glia/errors/error_types.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf61f6be102a1651954298dacfe9e93cfeb27f81ad078e52ec7bf16542bf402b
|
4
|
+
data.tar.gz: 2c9d1373869e3f9525d9f01116ecff9b5a09396b855c7c8ce1e3d9fc96eb43d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec694ade2f6c374c638832d8ad3a6d67523c218e296901b92560807dae34a29b173edc1eacde316c15c616ec063831886aec324da280b81fed6cc97840c435d4
|
7
|
+
data.tar.gz: d69081a24657b4647e7146d72c165e68b70698f548e7a0b2f1216ade437161a48d873a74b88adcb18f886f10d7fef4b60e0df589ce12466df707e40c7380d48f
|
data/README.md
CHANGED
@@ -62,7 +62,6 @@ url = URI('https://api.glia.com/engagement_requests')
|
|
62
62
|
|
63
63
|
http = Net::HTTP.new(url.host, url.port)
|
64
64
|
http.use_ssl = true
|
65
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
66
65
|
request = Net::HTTP::Post.new(url)
|
67
66
|
request["Accept"] = 'application/json'
|
68
67
|
request["Content-Type"] = 'application/json'
|
data/glia-errors.gemspec
CHANGED
@@ -171,6 +171,26 @@ module Glia
|
|
171
171
|
)
|
172
172
|
end
|
173
173
|
end
|
174
|
+
|
175
|
+
class AuthorizationError < Error
|
176
|
+
def initialize(message: nil)
|
177
|
+
super(
|
178
|
+
type: AUTHORIZATION_ERROR,
|
179
|
+
ref: "https://example.com/errors/#{AUTHORIZATION_ERROR}.html",
|
180
|
+
message: message || 'You do not have permissions to perform the action'
|
181
|
+
)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
class RecipientOptedOutError < Error
|
186
|
+
def initialize(message: nil)
|
187
|
+
super(
|
188
|
+
type: RECIPIENT_OPTED_OUT_ERROR,
|
189
|
+
ref: "https://example.com/errors/#{RECIPIENT_OPTED_OUT_ERROR}.html",
|
190
|
+
message: message || 'Recipient has opted out'
|
191
|
+
)
|
192
|
+
end
|
193
|
+
end
|
174
194
|
# rubocop:enable Style/Documentation
|
175
195
|
end
|
176
196
|
end
|
@@ -16,5 +16,7 @@ module Glia
|
|
16
16
|
LIMIT_EXCEEDED_ERROR = 'limit_exceeded_error'
|
17
17
|
RESOURCE_ALREADY_EXISTS_ERROR = 'resource_already_exists_error'
|
18
18
|
INVALID_RESOURCE_STATE_ERROR = 'invalid_resource_state_error'
|
19
|
+
AUTHORIZATION_ERROR = 'authorization_error'
|
20
|
+
RECIPIENT_OPTED_OUT_ERROR = 'recipient_opted_out_error'
|
19
21
|
end
|
20
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glia-errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Glia TechMovers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email:
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
|
-
rubygems_version: 3.
|
58
|
+
rubygems_version: 3.0.6
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Glia REST API errors
|