glia-errors 0.11.1 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/glia-errors.gemspec +1 -1
- data/lib/glia/errors/client_errors.rb +66 -2
- data/lib/glia/errors/error_types.rb +8 -1
- 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: bbaef28887dfc236d0f10cb730ac6dc44813f102bc8023da5fda37089815f318
|
4
|
+
data.tar.gz: 4e33efaa3c820a47896b3b69b859f00fbebcc2477ae0dc8d796f3eab6ed4b17a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52bdf038de5e035b2825c870d0f9912e93aa27254c464c2b55c5dac3864d429e05455b283fba81105cd03c0ba837b1d4aaf957d89af8b82f359c514bb0093c76
|
7
|
+
data.tar.gz: fb6f1cd85a31526f692be5d5a4201074decaf2f82d1d40fec3bee9f24b43683c9300bc707c2ea918f7dfd73b1bfbcd92db4b70aabf05a3c65e0092c8ad5fe359
|
data/glia-errors.gemspec
CHANGED
@@ -184,14 +184,27 @@ module Glia
|
|
184
184
|
Naming.assert_snake_case(resource)
|
185
185
|
|
186
186
|
super(
|
187
|
-
type:
|
188
|
-
ref: create_ref(
|
187
|
+
type: RESOURCE_LIMIT_EXCEEDED_ERROR,
|
188
|
+
ref: create_ref(RESOURCE_LIMIT_EXCEEDED_ERROR),
|
189
189
|
message: message || "#{Naming.humanize(resource)} count must not exceed #{max}",
|
190
190
|
error_details: { resource: resource, max: max }
|
191
191
|
)
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
+
class ResourceMinimumNotReachedError < Error
|
196
|
+
def initialize(resource:, min:, message: nil)
|
197
|
+
Naming.assert_snake_case(resource)
|
198
|
+
|
199
|
+
super(
|
200
|
+
type: RESOURCE_MINIMUM_NOT_REACHED,
|
201
|
+
ref: create_ref(RESOURCE_MINIMUM_NOT_REACHED),
|
202
|
+
message: message || "#{Naming.humanize(resource)} count must reach at least #{min}",
|
203
|
+
error_details: { resource: resource, min: min }
|
204
|
+
)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
195
208
|
class ResourceAlreadyExistsError < Error
|
196
209
|
def initialize(resource:, message: nil)
|
197
210
|
Naming.assert_snake_case(resource)
|
@@ -347,6 +360,57 @@ module Glia
|
|
347
360
|
)
|
348
361
|
end
|
349
362
|
end
|
363
|
+
|
364
|
+
class FacebookAccessTokenPermissionsError < Error
|
365
|
+
def initialize(message: nil)
|
366
|
+
super(
|
367
|
+
type: FACEBOOK_ACCESS_TOKEN_PERMISSIONS_ERROR,
|
368
|
+
ref: create_ref(FACEBOOK_ACCESS_TOKEN_PERMISSIONS_ERROR),
|
369
|
+
message: message || 'Access token does not have sufficient permissions'
|
370
|
+
)
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
class FacebookAccessTokenNotPermanentError < Error
|
375
|
+
def initialize(message: nil)
|
376
|
+
super(
|
377
|
+
type: FACEBOOK_ACCESS_TOKEN_NOT_PERMANENT_ERROR,
|
378
|
+
ref: create_ref(FACEBOOK_ACCESS_TOKEN_NOT_PERMANENT_ERROR),
|
379
|
+
message: message || 'Access token does not yield permanent access tokens'
|
380
|
+
)
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
class OAuthCodeExpiredError < Error
|
385
|
+
def initialize(message: nil)
|
386
|
+
super(
|
387
|
+
type: OAUTH_CODE_EXPIRED_ERROR,
|
388
|
+
ref: create_ref(OAUTH_CODE_EXPIRED_ERROR),
|
389
|
+
message: message || 'OAuth code has expired'
|
390
|
+
)
|
391
|
+
end
|
392
|
+
end
|
393
|
+
|
394
|
+
class OAuthCodeAlreadyUsedError < Error
|
395
|
+
def initialize(message: nil)
|
396
|
+
super(
|
397
|
+
type: OAUTH_CODE_ALREADY_USED_ERROR,
|
398
|
+
ref: create_ref(OAUTH_CODE_ALREADY_USED_ERROR),
|
399
|
+
message: message || 'OAuth code has already been used'
|
400
|
+
)
|
401
|
+
end
|
402
|
+
end
|
403
|
+
|
404
|
+
class AppleBusinessChatBusinessUsedByOtherSiteError < Error
|
405
|
+
def initialize(message: nil)
|
406
|
+
super(
|
407
|
+
type: APPLE_BUSINESS_CHAT_BUSINESS_USED_BY_OTHER_SITE_ERROR,
|
408
|
+
ref: create_ref(APPLE_BUSINESS_CHAT_BUSINESS_USED_BY_OTHER_SITE_ERROR),
|
409
|
+
message: message || 'Business is already used by a channel on another site'
|
410
|
+
)
|
411
|
+
end
|
412
|
+
end
|
413
|
+
|
350
414
|
# rubocop:enable Style/Documentation
|
351
415
|
end
|
352
416
|
end
|
@@ -14,7 +14,8 @@ module Glia
|
|
14
14
|
RESOURCE_NOT_FOUND_ERROR = 'resource_not_found_error'
|
15
15
|
NOT_VERIFIED_ERROR = 'not_verified_error'
|
16
16
|
REMAINING_ASSOCIATION_ERROR = 'remaining_association_error'
|
17
|
-
|
17
|
+
RESOURCE_LIMIT_EXCEEDED_ERROR = 'resource_limit_exceeded_error'
|
18
|
+
RESOURCE_MINIMUM_NOT_REACHED = 'resource_minimum_not_reached'
|
18
19
|
RESOURCE_ALREADY_EXISTS_ERROR = 'resource_already_exists_error'
|
19
20
|
INVALID_RESOURCE_STATE_ERROR = 'invalid_resource_state_error'
|
20
21
|
AUTHORIZATION_ERROR = 'authorization_error'
|
@@ -29,6 +30,12 @@ module Glia
|
|
29
30
|
TWILIO_MESSAGING_SERVICE_CONFIGURATION_ERROR = 'twilio_messaging_service_configuration_error'
|
30
31
|
UNREACHABLE_DESTINATION_ERROR = 'unreachable_destination_error'
|
31
32
|
HEADERS_VALIDATION_ERROR = 'headers_validation_error'
|
33
|
+
FACEBOOK_ACCESS_TOKEN_PERMISSIONS_ERROR = 'facebook_access_token_permissions_error'
|
34
|
+
FACEBOOK_ACCESS_TOKEN_NOT_PERMANENT_ERROR = 'facebook_access_token_not_permanent_error'
|
35
|
+
OAUTH_CODE_EXPIRED_ERROR = 'oauth_code_expired_error'
|
36
|
+
OAUTH_CODE_ALREADY_USED_ERROR = 'oauth_code_already_used_error'
|
37
|
+
APPLE_BUSINESS_CHAT_BUSINESS_USED_BY_OTHER_SITE_ERROR =
|
38
|
+
'apple_business_chat_business_used_by_other_site_error'
|
32
39
|
|
33
40
|
# Server errors
|
34
41
|
INTERNAL_SERVER_ERROR = 'internal_server_error'
|
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.11.
|
4
|
+
version: 0.11.4
|
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-
|
11
|
+
date: 2021-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email:
|