railerr 0.0.1 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d4bd95812d58ddf87e8b5a1d8deb962f3c10d329ad32108c537d0e8e5df1c16
4
- data.tar.gz: 86311328d87f4a159f6495ba15c1cc592b22e62eb1cccebc7226d33784f1c9c3
3
+ metadata.gz: 1aaaa20a464c7da7f9017bcc550ccce26e33e85af652240a15561463ca039643
4
+ data.tar.gz: f78408401d59668d20e4b1007d6e456c4239479be7de3017638652fe95a8dbee
5
5
  SHA512:
6
- metadata.gz: b46e3748f88ba6a72c236f0ba1f0f5a23def27253e488f685e1ca1c7b788e4ae834646bb404846b73c4745d86eb2c2ab73ab423190bc1c50bbf6be859704b0e3
7
- data.tar.gz: 8e73380426e860f6a9b2a1a95a8adfed7e7def951e44ce235e39f21f6e45aa4c4aae5fadc88c7526b07d41552fe0466b50dba964e994e0ed972b6cc79baa4f80
6
+ metadata.gz: 73bf3753f8096ab186413b098e28ef4faea4cfbc03999ebfc2a1c6533e44175e79a3faba62c5a9a614a003b7d2e4bf1a88924db2e97175dae81e6735dd998f79
7
+ data.tar.gz: 5f55448c6eeeef66b3b67febbbc9893813028c29f994af7af1516aea88432591335a0b0f2a010af4f132fc85564c91fea9931d530e9beca42a51f0ef65fa857a
@@ -21,12 +21,42 @@ module Railerr
21
21
  end
22
22
  end
23
23
 
24
+ # Raised for HTTP 502 Bad Gateway
25
+ class BadGatewayError < APIException
26
+ DEFAULT_MESSAGE = 'Bad gateway'
27
+ STATUS_CODE = Status::HTTP_502_BAD_GATEWAY
28
+ end
29
+
24
30
  # Raised for HTTP 400 Bad Request
25
31
  class BadRequestError < APIException
26
32
  DEFAULT_MESSAGE = 'Bad request'
27
33
  STATUS_CODE = Status::HTTP_400_BAD_REQUEST
28
34
  end
29
35
 
36
+ # Raised for HTTP 409 Conflict
37
+ class ConflictError < APIException
38
+ DEFAULT_MESSAGE = 'Conflict'
39
+ STATUS_CODE = Status::HTTP_409_CONFLICT
40
+ end
41
+
42
+ # Raised for HTTP 403 Forbidden
43
+ class ForbiddenError < APIException
44
+ DEFAULT_MESSAGE = 'Forbidden'
45
+ STATUS_CODE = Status::HTTP_403_FORBIDDEN
46
+ end
47
+
48
+ # Raised for HTTP 504 Gateway Timeout
49
+ class GatewayTimeoutError < APIException
50
+ DEFAULT_MESSAGE = 'Gateway timeout'
51
+ STATUS_CODE = Status::HTTP_504_GATEWAY_TIMEOUT
52
+ end
53
+
54
+ # Raised for HTTP 418 I'm A Teapot
55
+ class ImATeapotError < APIException
56
+ DEFAULT_MESSAGE = "I'm a teapot"
57
+ STATUS_CODE = Status::HTTP_418_IM_A_TEAPOT
58
+ end
59
+
30
60
  # Raised for HTTP 500 Internal Server Errors
31
61
  class InternalServerError < APIException
32
62
  DEFAULT_MESSAGE = 'Internal server error'
@@ -44,6 +74,24 @@ module Railerr
44
74
  STATUS_CODE = Status::HTTP_404_NOT_FOUND
45
75
  end
46
76
 
77
+ # Raised for HTTP 408 Request Timeout
78
+ class RequestTimeoutError < APIException
79
+ DEFAULT_MESSAGE = 'Request timeout'
80
+ STATUS_CODE = Status::HTTP_408_REQUEST_TIMEOUT
81
+ end
82
+
83
+ # Raised for HTTP 503 Service Unavailable
84
+ class ServiceUnavailableError < APIException
85
+ DEFAULT_MESSAGE = 'Service unavailable'
86
+ STATUS_CODE = Status::HTTP_503_SERVICE_UNAVAILABLE
87
+ end
88
+
89
+ # Raised for HTTP 401 Unauthorized
90
+ class UnauthorizedError < APIException
91
+ DEFAULT_MESSAGE = 'Unauthorized'
92
+ STATUS_CODE = Status::HTTP_401_UNAUTHORIZED
93
+ end
94
+
47
95
  # Raised for HTTP 422 Unprocessable Content
48
96
  class UnprocessableContentError < APIException
49
97
  DEFAULT_MESSAGE = 'Unprocessable content'
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Railerr
4
+ VERSION = '0.0.2'
5
+ end
data/lib/railerr.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  require_relative 'railerr/api_exceptions'
2
2
  require_relative 'railerr/status'
3
+ require_relative 'railerr/version'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railerr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernhard Niksch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-08 00:00:00.000000000 Z
11
+ date: 2024-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
19
+ version: '2.0'
20
+ type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -89,7 +89,8 @@ files:
89
89
  - lib/railerr.rb
90
90
  - lib/railerr/api_exceptions.rb
91
91
  - lib/railerr/status.rb
92
- homepage:
92
+ - lib/railerr/version.rb
93
+ homepage: https://github.com/BernhardNiksch/railerr
93
94
  licenses:
94
95
  - MIT
95
96
  metadata: {}