glia-errors 0.14.1 → 0.15.0
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/Gemfile.lock +1 -1
- data/glia-errors.gemspec +1 -1
- data/lib/glia/errors/client_errors.rb +30 -0
- data/lib/glia/errors/error_types.rb +5 -0
- data/lib/glia/errors/mapper.rb +1 -1
- data/lib/glia/errors/server_errors.rb +15 -0
- 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: ae72fe1322934f08cc64c13b2e9ad1d826e327a3efac260e14b2b0da26ad66a5
|
4
|
+
data.tar.gz: 6a9bc75c7e7f552edd739741ed636b048d7994442ba9d3885f5429ee4fc16a6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac2f2a450f442b6261bbbe7034ae2e8e4556261195a0fbae20e8cbe0d5a85035957005528c0aad23ab1ccd046d68a453a255ce0619d5a903e10c9a13efacf48e
|
7
|
+
data.tar.gz: 16e41309e3a229581f5bea5f1f25d7419123d4a25ce44ca5605e6a169eeae09175cf638074e44d6753240cceb670df2c926d13e10b72022bd4eb8c9032c0b2f3
|
data/Gemfile.lock
CHANGED
data/glia-errors.gemspec
CHANGED
@@ -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
|
data/lib/glia/errors/mapper.rb
CHANGED
@@ -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-
|
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.
|
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-
|
11
|
+
date: 2023-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email:
|