Skip to content

Commit 8d19041

Browse files
Merge pull request #77 from cronofy/add-service-unreachable-error
Add specific errors for network issues
2 parents 474702f + 07425f0 commit 8d19041

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [0.35.0]
2+
3+
* Add specific errors for network issues [#77]
4+
15
## [0.34.0]
26

37
* Support removing a participant from a Smart Invite [#75]
@@ -157,6 +161,7 @@
157161
[0.32.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.32.0
158162
[0.33.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.33.0
159163
[0.34.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.34.0
164+
[0.35.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.35.0
160165

161166
[#13]: https://github.com/cronofy/cronofy-ruby/pull/13
162167
[#16]: https://github.com/cronofy/cronofy-ruby/pull/16
@@ -195,3 +200,4 @@
195200
[#73]: https://github.com/cronofy/cronofy-ruby/pull/73
196201
[#74]: https://github.com/cronofy/cronofy-ruby/pull/74
197202
[#75]: https://github.com/cronofy/cronofy-ruby/pull/75
203+
[#77]: https://github.com/cronofy/cronofy-ruby/pull/77

lib/cronofy/errors.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ class ServerError < APIError
6868
class PaymentRequiredError < APIError
6969
end
7070

71+
class ServiceUnreachableError < APIError
72+
end
73+
74+
class BadGatewayError < ServiceUnreachableError
75+
end
76+
77+
class ServiceUnavailableError < ServiceUnreachableError
78+
end
79+
80+
class GatewayTimeoutError < ServiceUnreachableError
81+
end
82+
7183
class UnknownError < APIError
7284
end
7385

@@ -83,6 +95,9 @@ class Errors
8395
423 => AccountLockedError,
8496
429 => TooManyRequestsError,
8597
500 => ServerError,
98+
502 => BadGatewayError,
99+
503 => ServiceUnavailableError,
100+
504 => GatewayTimeoutError,
86101
}.freeze
87102

88103
def self.map_error(error)

lib/cronofy/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Cronofy
2-
VERSION = "0.34.0".freeze
2+
VERSION = "0.35.0".freeze
33
end

0 commit comments

Comments
 (0)