glia-errors 0.11.1 → 0.11.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c39d2869c04082f96dec69d927b471a4ea9a94444cd1b1fefa27c1927599f6d6
4
- data.tar.gz: f7858bf6b262b96e3dbd8c2463c6d62c299d9adb6a911b91cb0aa2c814196bdc
3
+ metadata.gz: bbaef28887dfc236d0f10cb730ac6dc44813f102bc8023da5fda37089815f318
4
+ data.tar.gz: 4e33efaa3c820a47896b3b69b859f00fbebcc2477ae0dc8d796f3eab6ed4b17a
5
5
  SHA512:
6
- metadata.gz: 2e01e99725306a950aa584ca37c00535f8a9bdcf1194e01961e325eb24393010df7afefadcd8e681536cc23c4594afec98e5622f4650b15c216a9e80ecce9149
7
- data.tar.gz: 0626d5fc71db27e69180411f3bf77fb436357d1ff3b12019646115cf09f129edabd0faf40a0d8b704c023739f804e4b07de61768f852a8221d35385e04c16335
6
+ metadata.gz: 52bdf038de5e035b2825c870d0f9912e93aa27254c464c2b55c5dac3864d429e05455b283fba81105cd03c0ba837b1d4aaf957d89af8b82f359c514bb0093c76
7
+ data.tar.gz: fb6f1cd85a31526f692be5d5a4201074decaf2f82d1d40fec3bee9f24b43683c9300bc707c2ea918f7dfd73b1bfbcd92db4b70aabf05a3c65e0092c8ad5fe359
data/glia-errors.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'glia-errors'
8
- spec.version = '0.11.1'
8
+ spec.version = '0.11.4'
9
9
  spec.authors = ['Glia TechMovers']
10
10
  spec.email = ['techmovers@glia.com']
11
11
 
@@ -184,14 +184,27 @@ module Glia
184
184
  Naming.assert_snake_case(resource)
185
185
 
186
186
  super(
187
- type: LIMIT_EXCEEDED_ERROR,
188
- ref: create_ref(LIMIT_EXCEEDED_ERROR),
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
- LIMIT_EXCEEDED_ERROR = 'limit_exceeded_error'
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.1
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-05-31 00:00:00.000000000 Z
11
+ date: 2021-08-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email: