glia-errors 0.16.0 → 0.17.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/.rubocop.yml +3 -0
- data/.snyk +9 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +34 -23
- data/README.md +1 -1
- data/catalog-info.yaml +1 -1
- data/glia-errors.gemspec +1 -2
- data/lib/glia/errors/client_errors.rb +22 -2
- data/lib/glia/errors/error.rb +1 -1
- data/lib/glia/errors/error_types.rb +2 -0
- data/lib/glia/errors.rb +5 -5
- metadata +3 -3
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb306023685715722d62f677ecaf4e0ff4f94af4dcfb89a6a2ac511a739fefab
|
|
4
|
+
data.tar.gz: 5706a493a85f09b8020755166293f9a3f043392ae7866ce697a8d5aa5d9c5e44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f80dbaf2134afcf36ca4e776bf33553f2c5325831a655c00f537ab787d54b5a141af14f996a0a85855c42a43f25d8aed9edf0bf763323df9ec7db3a238cca61
|
|
7
|
+
data.tar.gz: dd26f9022da7e943829e88e9ed98edb97e7d60246bf149571d9ae7023da37bd1dc039cd65b563898073c6cfaf95e7e242fdc1f2f1257e607ba8b96f25f440a05
|
data/.rubocop.yml
CHANGED
data/.snyk
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
|
2
|
+
version: v1.25.1
|
|
3
|
+
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
|
|
4
|
+
ignore:
|
|
5
|
+
'snyk:lic:rubygems:json:Ruby':
|
|
6
|
+
- '*':
|
|
7
|
+
reason: >-
|
|
8
|
+
It is a reciprocal license, meaning we can use this dependency in
|
|
9
|
+
unmodified form, which we do.
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
glia-errors (0.
|
|
4
|
+
glia-errors (0.17.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
ast (2.4.
|
|
9
|
+
ast (2.4.3)
|
|
10
10
|
attr_extras (6.2.5)
|
|
11
|
-
concurrent-ruby (1.
|
|
11
|
+
concurrent-ruby (1.3.7)
|
|
12
12
|
diff-lcs (1.5.0)
|
|
13
13
|
dry-configurable (1.0.1)
|
|
14
14
|
dry-core (~> 1.0, < 2)
|
|
@@ -42,16 +42,21 @@ GEM
|
|
|
42
42
|
dry-initializer (~> 3.0)
|
|
43
43
|
dry-schema (>= 1.12, < 2)
|
|
44
44
|
zeitwerk (~> 2.6)
|
|
45
|
+
json (2.21.2)
|
|
46
|
+
language_server-protocol (3.17.0.5)
|
|
47
|
+
lint_roller (1.1.0)
|
|
45
48
|
optimist (3.0.1)
|
|
46
|
-
parallel (1.
|
|
47
|
-
parser (3.
|
|
49
|
+
parallel (1.28.0)
|
|
50
|
+
parser (3.3.11.1)
|
|
48
51
|
ast (~> 2.4.1)
|
|
52
|
+
racc
|
|
49
53
|
patience_diff (1.2.0)
|
|
50
54
|
optimist (~> 3.0)
|
|
55
|
+
prism (1.9.0)
|
|
56
|
+
racc (1.8.1)
|
|
51
57
|
rainbow (3.1.1)
|
|
52
58
|
rake (13.0.1)
|
|
53
|
-
regexp_parser (2.
|
|
54
|
-
rexml (3.2.5)
|
|
59
|
+
regexp_parser (2.12.0)
|
|
55
60
|
rspec (3.10.0)
|
|
56
61
|
rspec-core (~> 3.10.0)
|
|
57
62
|
rspec-expectations (~> 3.10.0)
|
|
@@ -65,27 +70,33 @@ GEM
|
|
|
65
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
66
71
|
rspec-support (~> 3.10.0)
|
|
67
72
|
rspec-support (3.10.0)
|
|
68
|
-
rubocop (1.
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
rubocop (1.86.1)
|
|
74
|
+
json (~> 2.3)
|
|
75
|
+
language_server-protocol (~> 3.17.0.2)
|
|
76
|
+
lint_roller (~> 1.1.0)
|
|
77
|
+
parallel (>= 1.10)
|
|
78
|
+
parser (>= 3.3.0.2)
|
|
71
79
|
rainbow (>= 2.2.2, < 4.0)
|
|
72
|
-
regexp_parser (>=
|
|
73
|
-
|
|
74
|
-
rubocop-ast (>= 1.16.0, < 2.0)
|
|
80
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
81
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
75
82
|
ruby-progressbar (~> 1.7)
|
|
76
|
-
unicode-display_width (>=
|
|
77
|
-
rubocop-ast (1.
|
|
78
|
-
parser (>= 3.
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
84
|
+
rubocop-ast (1.49.1)
|
|
85
|
+
parser (>= 3.3.7.2)
|
|
86
|
+
prism (~> 1.7)
|
|
87
|
+
rubocop-rake (0.7.1)
|
|
88
|
+
lint_roller (~> 1.1)
|
|
89
|
+
rubocop (>= 1.72.1)
|
|
81
90
|
rubocop-rspec (2.9.0)
|
|
82
91
|
rubocop (~> 1.19)
|
|
83
|
-
ruby-progressbar (1.
|
|
92
|
+
ruby-progressbar (1.13.0)
|
|
84
93
|
super_diff (0.8.0)
|
|
85
94
|
attr_extras (>= 6.2.4)
|
|
86
95
|
diff-lcs
|
|
87
96
|
patience_diff
|
|
88
|
-
unicode-display_width (2.
|
|
97
|
+
unicode-display_width (3.2.0)
|
|
98
|
+
unicode-emoji (~> 4.1)
|
|
99
|
+
unicode-emoji (4.2.0)
|
|
89
100
|
zeitwerk (2.6.6)
|
|
90
101
|
|
|
91
102
|
PLATFORMS
|
|
@@ -97,10 +108,10 @@ DEPENDENCIES
|
|
|
97
108
|
glia-errors!
|
|
98
109
|
rake (~> 13.0)
|
|
99
110
|
rspec (~> 3.10)
|
|
100
|
-
rubocop (~> 1.
|
|
101
|
-
rubocop-rake (~> 0.
|
|
111
|
+
rubocop (~> 1.28)
|
|
112
|
+
rubocop-rake (~> 0.7)
|
|
102
113
|
rubocop-rspec (~> 2.0)
|
|
103
114
|
super_diff
|
|
104
115
|
|
|
105
116
|
BUNDLED WITH
|
|
106
|
-
2.
|
|
117
|
+
2.4.19
|
data/README.md
CHANGED
|
@@ -107,7 +107,7 @@ end
|
|
|
107
107
|
## Releasing a new version
|
|
108
108
|
|
|
109
109
|
A new version is created when a change is merged into the master branch that changes the version number in `glia-errors.gemspec`.
|
|
110
|
-
A Github Action will push the `.gem` file to [rubygems.org](https://rubygems.org)
|
|
110
|
+
A Github Action will push the `.gem` file to [rubygems.org](https://rubygems.org) and tag the commit as `ruby-v<version>`.
|
|
111
111
|
|
|
112
112
|
## Contributing
|
|
113
113
|
|
data/catalog-info.yaml
CHANGED
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.
|
|
8
|
+
spec.version = '0.17.0'
|
|
9
9
|
spec.authors = ['Glia TechMovers']
|
|
10
10
|
spec.email = ['techmovers@glia.com']
|
|
11
11
|
|
|
@@ -16,7 +16,6 @@ Gem::Specification.new do |spec|
|
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
17
17
|
f.match(%r{^(test|spec|features)/})
|
|
18
18
|
end
|
|
19
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
20
19
|
spec.require_paths = ['lib']
|
|
21
20
|
|
|
22
21
|
spec.required_ruby_version = '>= 2.5', '< 4.0'
|
|
@@ -5,7 +5,7 @@ module Glia
|
|
|
5
5
|
# rubocop:disable Style/Documentation
|
|
6
6
|
class InputValidationError < Error
|
|
7
7
|
def initialize(error_details:, message: nil)
|
|
8
|
-
raise ArgumentError, 'At least 1 error detail is required' if error_details.keys.
|
|
8
|
+
raise ArgumentError, 'At least 1 error detail is required' if error_details.keys.none?
|
|
9
9
|
|
|
10
10
|
error_details.each_value do |value|
|
|
11
11
|
raise ArgumentError, 'error_details values must be lists' unless value.is_a?(Array)
|
|
@@ -373,7 +373,7 @@ module Glia
|
|
|
373
373
|
|
|
374
374
|
class HeadersValidationError < Error
|
|
375
375
|
def initialize(error_details:, message: nil)
|
|
376
|
-
raise ArgumentError, 'At least 1 error detail is required' if error_details.keys.
|
|
376
|
+
raise ArgumentError, 'At least 1 error detail is required' if error_details.keys.none?
|
|
377
377
|
|
|
378
378
|
error_details.each_value do |value|
|
|
379
379
|
raise ArgumentError, 'error_details values must be lists' unless value.is_a?(Array)
|
|
@@ -499,6 +499,26 @@ module Glia
|
|
|
499
499
|
end
|
|
500
500
|
end
|
|
501
501
|
|
|
502
|
+
class PayloadTooLargeError < Error
|
|
503
|
+
def initialize(message: nil)
|
|
504
|
+
super(
|
|
505
|
+
type: PAYLOAD_TOO_LARGE_ERROR,
|
|
506
|
+
ref: create_ref(PAYLOAD_TOO_LARGE_ERROR),
|
|
507
|
+
message: message || 'Payload Too Large'
|
|
508
|
+
)
|
|
509
|
+
end
|
|
510
|
+
end
|
|
511
|
+
|
|
512
|
+
class RequestTimeoutError < Error
|
|
513
|
+
def initialize(message: nil)
|
|
514
|
+
super(
|
|
515
|
+
type: REQUEST_TIMEOUT_ERROR,
|
|
516
|
+
ref: create_ref(REQUEST_TIMEOUT_ERROR),
|
|
517
|
+
message: message || 'Request Timeout'
|
|
518
|
+
)
|
|
519
|
+
end
|
|
520
|
+
end
|
|
521
|
+
|
|
502
522
|
# rubocop:enable Style/Documentation
|
|
503
523
|
end
|
|
504
524
|
end
|
data/lib/glia/errors/error.rb
CHANGED
|
@@ -42,6 +42,8 @@ module Glia
|
|
|
42
42
|
UNSUPPORTED_MEDIA_TYPE_ERROR = 'unsupported_media_type'
|
|
43
43
|
TOO_MANY_REQUESTS_ERROR = 'too_many_requests'
|
|
44
44
|
NO_MATCHING_ROUTING_RULE_ERROR = 'no_matching_routing_rule_error'
|
|
45
|
+
PAYLOAD_TOO_LARGE_ERROR = 'payload_too_large_error'
|
|
46
|
+
REQUEST_TIMEOUT_ERROR = 'request_timeout_error'
|
|
45
47
|
|
|
46
48
|
# Server errors
|
|
47
49
|
INTERNAL_SERVER_ERROR = 'internal_server_error'
|
data/lib/glia/errors.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '
|
|
4
|
-
require_relative '
|
|
5
|
-
require_relative '
|
|
6
|
-
require_relative '
|
|
7
|
-
require_relative '
|
|
3
|
+
require_relative 'errors/error'
|
|
4
|
+
require_relative 'errors/error_types'
|
|
5
|
+
require_relative 'errors/client_errors'
|
|
6
|
+
require_relative 'errors/server_errors'
|
|
7
|
+
require_relative 'errors/mapper'
|
|
8
8
|
|
|
9
9
|
module Glia
|
|
10
10
|
# Glia REST API errors
|
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.17.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:
|
|
11
|
+
date: 2026-08-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: ''
|
|
14
14
|
email:
|
|
@@ -20,7 +20,7 @@ files:
|
|
|
20
20
|
- ".gitignore"
|
|
21
21
|
- ".rspec"
|
|
22
22
|
- ".rubocop.yml"
|
|
23
|
-
- ".
|
|
23
|
+
- ".snyk"
|
|
24
24
|
- Gemfile
|
|
25
25
|
- Gemfile.lock
|
|
26
26
|
- README.md
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ruby-3.1
|