rock_rms 4.18.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rock_rms/error.rb +18 -0
- data/lib/rock_rms/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cdc3ac5eda8e89243df3cdf319e1ea4d0a2db7a
|
4
|
+
data.tar.gz: b3ba9b0089c70ed7cd709e3857b2a16e2ade5e45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 673884c975f563c2945dafdc321611b989c8d5e6a87914c2fa26c6806b245107c932cd84ae29e2376b8b3e2d3f807501c39dd36161436ff0efc31e6b7001ea96
|
7
|
+
data.tar.gz: a4eb7aa401b7c6fa52aa651cb4953ddedcd9969ba445b72609500253d9d4d4c0982828cf82c46d298c49a9f5b3eb9789671938f57d0495c3cd7688e05b1e23a5
|
data/lib/rock_rms/error.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
module RockRMS
|
2
2
|
class Error < StandardError; end
|
3
|
+
class BadRequest < Error; end
|
4
|
+
class Forbidden < Error; end
|
5
|
+
class GatewayTimeout < Error; end
|
6
|
+
class InternalServerError < Error; end
|
7
|
+
class NotFound < Error; end
|
8
|
+
class Unauthorized < Error; end
|
3
9
|
end
|
4
10
|
|
5
11
|
require 'faraday'
|
@@ -9,6 +15,18 @@ module FaradayMiddleware
|
|
9
15
|
|
10
16
|
def on_complete(env)
|
11
17
|
case env[:status]
|
18
|
+
when 400
|
19
|
+
raise RockRMS::BadRequest, "#{env[:status]}: #{env[:body]} #{env[:url]}"
|
20
|
+
when 401
|
21
|
+
raise RockRMS::Unauthorized, "#{env[:status]}: #{env[:body]} #{env[:url]}"
|
22
|
+
when 403
|
23
|
+
raise RockRMS::Forbidden, "#{env[:status]}: #{env[:body]} #{env[:url]}"
|
24
|
+
when 404
|
25
|
+
raise RockRMS::NotFound, "#{env[:status]}: #{env[:body]} #{env[:url]}"
|
26
|
+
when 500
|
27
|
+
raise RockRMS::InternalServerError, "#{env[:status]}: #{env[:body]} #{env[:url]}"
|
28
|
+
when 504
|
29
|
+
raise RockRMS::GatewayTimeout, "#{env[:status]}: #{env[:body]} #{env[:url]}"
|
12
30
|
when ERROR_STATUSES
|
13
31
|
raise RockRMS::Error, "#{env[:status]}: #{env[:body]} #{env[:url]}"
|
14
32
|
end
|
data/lib/rock_rms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rock_rms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Brooks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|