http-errors 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/http-errors-0.1.0.gem +0 -0
- data/lib/http_error/response.rb +13 -8
- data/lib/http_error/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0670ef6f5cf56d85ed94be70116811f22b8ebc6a07fe5a39c7cb40b9dda87a7
|
4
|
+
data.tar.gz: 52d14a9ae364056fc387b30bdace07c81ab7f2ffbac48013b5b5a06cd8f05dfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baeae7036992947916b95cb6fcc37557db377d3081074a3cb05b7cc0408d13a94a72bc7eb8ccf7ba019f7aea3df3a66701f24e079f807a5f2a745f4129920b90
|
7
|
+
data.tar.gz: 62bfc91b53da0207bda75493dacee3b4691f7d2227d4530ed9f63e590f42db5654714b658259ddee5103d5e6b7a9300eea2bc338977c11218fd9785f2a1487b7
|
data/Gemfile.lock
CHANGED
Binary file
|
data/lib/http_error/response.rb
CHANGED
@@ -5,16 +5,21 @@ module HttpError
|
|
5
5
|
included do
|
6
6
|
rescue_from HttpError::Error do |error|
|
7
7
|
Rails.logger.debug "Rescuing from #{error.class}. Status: #{error.status}. Message: #{error.message}"
|
8
|
+
render_error error
|
9
|
+
end
|
8
10
|
|
9
|
-
|
10
|
-
error: error.message,
|
11
|
-
}
|
11
|
+
private
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
def render_error(error)
|
14
|
+
hash = {
|
15
|
+
error: error.message,
|
16
|
+
}
|
17
|
+
|
18
|
+
render \
|
19
|
+
text: error.message,
|
20
|
+
json: hash,
|
21
|
+
status: error.status
|
22
|
+
end
|
18
23
|
end
|
19
24
|
end
|
20
25
|
end
|
data/lib/http_error/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http-errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Kampp
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- Rakefile
|
84
84
|
- bin/console
|
85
85
|
- bin/setup
|
86
|
+
- http-errors-0.1.0.gem
|
86
87
|
- http_errors.gemspec
|
87
88
|
- lib/http_error.rb
|
88
89
|
- lib/http_error/bad_request.rb
|