tremendous_ruby 4.3.1 → 4.3.2
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/lib/tremendous/error.rb +73 -1
- data/lib/tremendous/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d0459f548abb2ef14bbdcf0616c37dc6e94af7a725d4134ee1afe55b5b1cf620
|
|
4
|
+
data.tar.gz: 97be2c465c3c7016152c9a469861bbb86e79f384144e31bfab8d060512c6f43a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d27cc3094aa4cf4ddd13974ed55887f2512c856a95fed790ae369a8d45104170a40346d606e7e24a43231e2550e005eef519bf0f2407b51f008bd53ae9a9eb2
|
|
7
|
+
data.tar.gz: f9d5f15977c8fd923d5792e005026f209c5f376b60fbc45bca1806f3d15531edfe3b7be772e5c9b785c76cf1a91ff0dd1606dca05c4eed0a69488feb5f133406
|
data/lib/tremendous/error.rb
CHANGED
|
@@ -1,13 +1,85 @@
|
|
|
1
1
|
module Tremendous
|
|
2
2
|
class Error < StandardError
|
|
3
3
|
|
|
4
|
+
HTTP_STATUS_CODES = {
|
|
5
|
+
100 => 'Continue',
|
|
6
|
+
101 => 'Switching Protocols',
|
|
7
|
+
102 => 'Processing',
|
|
8
|
+
103 => 'Early Hints',
|
|
9
|
+
200 => 'OK',
|
|
10
|
+
201 => 'Created',
|
|
11
|
+
202 => 'Accepted',
|
|
12
|
+
203 => 'Non-Authoritative Information',
|
|
13
|
+
204 => 'No Content',
|
|
14
|
+
205 => 'Reset Content',
|
|
15
|
+
206 => 'Partial Content',
|
|
16
|
+
207 => 'Multi-Status',
|
|
17
|
+
208 => 'Already Reported',
|
|
18
|
+
226 => 'IM Used',
|
|
19
|
+
300 => 'Multiple Choices',
|
|
20
|
+
301 => 'Moved Permanently',
|
|
21
|
+
302 => 'Found',
|
|
22
|
+
303 => 'See Other',
|
|
23
|
+
304 => 'Not Modified',
|
|
24
|
+
305 => 'Use Proxy',
|
|
25
|
+
306 => '(Unused)',
|
|
26
|
+
307 => 'Temporary Redirect',
|
|
27
|
+
308 => 'Permanent Redirect',
|
|
28
|
+
400 => 'Bad Request',
|
|
29
|
+
401 => 'Unauthorized',
|
|
30
|
+
402 => 'Payment Required',
|
|
31
|
+
403 => 'Forbidden',
|
|
32
|
+
404 => 'Not Found',
|
|
33
|
+
405 => 'Method Not Allowed',
|
|
34
|
+
406 => 'Not Acceptable',
|
|
35
|
+
407 => 'Proxy Authentication Required',
|
|
36
|
+
408 => 'Request Timeout',
|
|
37
|
+
409 => 'Conflict',
|
|
38
|
+
410 => 'Gone',
|
|
39
|
+
411 => 'Length Required',
|
|
40
|
+
412 => 'Precondition Failed',
|
|
41
|
+
413 => 'Payload Too Large',
|
|
42
|
+
414 => 'URI Too Long',
|
|
43
|
+
415 => 'Unsupported Media Type',
|
|
44
|
+
416 => 'Range Not Satisfiable',
|
|
45
|
+
417 => 'Expectation Failed',
|
|
46
|
+
421 => 'Misdirected Request',
|
|
47
|
+
422 => 'Unprocessable Entity',
|
|
48
|
+
423 => 'Locked',
|
|
49
|
+
424 => 'Failed Dependency',
|
|
50
|
+
425 => 'Too Early',
|
|
51
|
+
426 => 'Upgrade Required',
|
|
52
|
+
428 => 'Precondition Required',
|
|
53
|
+
429 => 'Too Many Requests',
|
|
54
|
+
431 => 'Request Header Fields Too Large',
|
|
55
|
+
451 => 'Unavailable for Legal Reasons',
|
|
56
|
+
500 => 'Internal Server Error',
|
|
57
|
+
501 => 'Not Implemented',
|
|
58
|
+
502 => 'Bad Gateway',
|
|
59
|
+
503 => 'Service Unavailable',
|
|
60
|
+
504 => 'Gateway Timeout',
|
|
61
|
+
505 => 'HTTP Version Not Supported',
|
|
62
|
+
506 => 'Variant Also Negotiates',
|
|
63
|
+
507 => 'Insufficient Storage',
|
|
64
|
+
508 => 'Loop Detected',
|
|
65
|
+
509 => 'Bandwidth Limit Exceeded',
|
|
66
|
+
510 => 'Not Extended',
|
|
67
|
+
511 => 'Network Authentication Required'
|
|
68
|
+
}
|
|
69
|
+
|
|
4
70
|
def initialize(response)
|
|
5
71
|
@response = response
|
|
6
72
|
super
|
|
7
73
|
end
|
|
8
74
|
|
|
9
75
|
def server_response
|
|
10
|
-
@server_response ||=
|
|
76
|
+
@server_response ||= parsed_response
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def parsed_response
|
|
80
|
+
@response.parsed_response.with_indifferent_access
|
|
81
|
+
rescue StandardError
|
|
82
|
+
{ errors: [ HTTP_STATUS_CODES[@response.code] ] }
|
|
11
83
|
end
|
|
12
84
|
|
|
13
85
|
def message
|
data/lib/tremendous/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tremendous_ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.3.
|
|
4
|
+
version: 4.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tremendous Developers
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-02-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
138
138
|
- !ruby/object:Gem::Version
|
|
139
139
|
version: '0'
|
|
140
140
|
requirements: []
|
|
141
|
-
rubygems_version: 3.
|
|
141
|
+
rubygems_version: 3.1.6
|
|
142
142
|
signing_key:
|
|
143
143
|
specification_version: 4
|
|
144
144
|
summary: Tremendous Ruby API SDK
|