glia-errors 0.14.1 → 0.15.0

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: ed191a541738bdb411e948565ed5a52047b4e091137843353306212965ac13c0
4
- data.tar.gz: 00e89550af7bd420ccd503031790d39a40fec53a30004213f1d8dea05c731c50
3
+ metadata.gz: ae72fe1322934f08cc64c13b2e9ad1d826e327a3efac260e14b2b0da26ad66a5
4
+ data.tar.gz: 6a9bc75c7e7f552edd739741ed636b048d7994442ba9d3885f5429ee4fc16a6f
5
5
  SHA512:
6
- metadata.gz: 7c829ab7ae9521732d506c329998cb361ea75e33228b9ed75a235056fb2e0e3b9784cfaae5db83b2bf5582799ef45e878735985b26e8faa59d299f02c6053744
7
- data.tar.gz: e873b734312305383851a5c24d171fb1a7082d4c644ffb60c9c03ec7bf5a501f1b14705e01263254ff222cffa785428394859a5485741a440ed9af255cc09ede
6
+ metadata.gz: ac2f2a450f442b6261bbbe7034ae2e8e4556261195a0fbae20e8cbe0d5a85035957005528c0aad23ab1ccd046d68a453a255ce0619d5a903e10c9a13efacf48e
7
+ data.tar.gz: 16e41309e3a229581f5bea5f1f25d7419123d4a25ce44ca5605e6a169eeae09175cf638074e44d6753240cceb670df2c926d13e10b72022bd4eb8c9032c0b2f3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- glia-errors (0.14.0)
4
+ glia-errors (0.15.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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.14.1'
8
+ spec.version = '0.15.0'
9
9
  spec.authors = ['Glia TechMovers']
10
10
  spec.email = ['techmovers@glia.com']
11
11
 
@@ -442,6 +442,36 @@ module Glia
442
442
  end
443
443
  end
444
444
 
445
+ class FeatureDisabledError < Error
446
+ def initialize(feature:, message: nil)
447
+ super(
448
+ type: FEATURE_DISABLED_ERROR,
449
+ ref: create_ref(FEATURE_DISABLED_ERROR),
450
+ message: message || "#{Naming.humanize(feature)} is disabled"
451
+ )
452
+ end
453
+ end
454
+
455
+ class UnsupportedMediaTypeError < Error
456
+ def initialize(message: nil)
457
+ super(
458
+ type: UNSUPPORTED_MEDIA_TYPE_ERROR,
459
+ ref: create_ref(UNSUPPORTED_MEDIA_TYPE_ERROR),
460
+ message: message || 'Unsupported Media Type'
461
+ )
462
+ end
463
+ end
464
+
465
+ class TooManyRequestsError < Error
466
+ def initialize(message: nil)
467
+ super(
468
+ type: TOO_MANY_REQUESTS_ERROR,
469
+ ref: create_ref(TOO_MANY_REQUESTS_ERROR),
470
+ message: message || 'Too Many Requests'
471
+ )
472
+ end
473
+ end
474
+
445
475
  # rubocop:enable Style/Documentation
446
476
  end
447
477
  end
@@ -37,9 +37,14 @@ module Glia
37
37
  OAUTH_CODE_ALREADY_USED_ERROR = 'oauth_code_already_used_error'
38
38
  APPLE_BUSINESS_CHAT_BUSINESS_USED_BY_OTHER_SITE_ERROR = 'apple_business_chat_business_used_by_other_site_error'
39
39
  ITEMS_OVERLAP_ERROR = 'items_overlap_error'
40
+ FEATURE_DISABLED_ERROR = 'feature_disabled_error'
41
+ UNSUPPORTED_MEDIA_TYPE_ERROR = 'unsupported_media_type'
42
+ TOO_MANY_REQUESTS_ERROR = 'too_many_requests'
40
43
 
41
44
  # Server errors
42
45
  INTERNAL_SERVER_ERROR = 'internal_server_error'
43
46
  SERVICE_UNAVAILABLE_ERROR = 'service_unavailable_error'
47
+ BAD_GATEWAY_ERROR = 'bad_gateway_error'
48
+ GATEWAY_TIMEOUT_ERROR = 'gateway_timeout_error'
44
49
  end
45
50
  end
@@ -120,7 +120,7 @@ module Glia
120
120
  'is missing' => MISSING_VALUE_ERROR,
121
121
  # Custom format errors
122
122
  'must be in E.164 format' => INVALID_FORMAT_ERROR,
123
- 'must be up to 25 symbol string that contains 1-7 digits or hashes and any number of commas' =>
123
+ 'must be up to 25 symbol string that contains 1-25 digits or hashes and any number of commas' =>
124
124
  INVALID_FORMAT_ERROR,
125
125
  'must be a valid email' => INVALID_FORMAT_ERROR
126
126
  }.freeze
@@ -13,6 +13,12 @@ module Glia
13
13
  end
14
14
  end
15
15
 
16
+ class BadGatewayError < Error
17
+ def initialize(message: nil)
18
+ super(type: BAD_GATEWAY_ERROR, ref: create_ref(BAD_GATEWAY_ERROR), message: message || 'Bad Gateway')
19
+ end
20
+ end
21
+
16
22
  class ServiceUnavailableError < Error
17
23
  def initialize(message: nil)
18
24
  super(
@@ -22,6 +28,15 @@ module Glia
22
28
  )
23
29
  end
24
30
  end
31
+
32
+ class GatewayTimeoutError < Error
33
+ def initialize(message: nil)
34
+ super(
35
+ type: GATEWAY_TIMEOUT_ERROR, ref: create_ref(GATEWAY_TIMEOUT_ERROR), message: message || 'Gateway Timeout'
36
+ )
37
+ end
38
+ end
39
+
25
40
  # rubocop:enable Style/Documentation
26
41
  end
27
42
  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.14.1
4
+ version: 0.15.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: 2023-06-19 00:00:00.000000000 Z
11
+ date: 2023-10-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email: