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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a271c0fe06315eced591d92050aea5e00c78c8d54b15a4dd1716ec99f5ced8e
4
- data.tar.gz: 9c4649b2a906dcb41dce8da9f5ee08de560cade21d29a54ef686e8762eb05080
3
+ metadata.gz: c0670ef6f5cf56d85ed94be70116811f22b8ebc6a07fe5a39c7cb40b9dda87a7
4
+ data.tar.gz: 52d14a9ae364056fc387b30bdace07c81ab7f2ffbac48013b5b5a06cd8f05dfb
5
5
  SHA512:
6
- metadata.gz: 769b0fdac3e1f9251e60384dfa59dbd0c18b6ec4d5ad9e697699136903b4d63aa4e9ebde5a75187a6a523e91d938d6935c5f2c8062dae621a1eff4bdd92bd840
7
- data.tar.gz: 94eb2f036196a25ff6b8b2cba58a78c4bfe1e7205ef1df494df0f3b52137631420350f0b533580970ee7f11df4c8ca250695589a6b6cd659224b8f167261e161
6
+ metadata.gz: baeae7036992947916b95cb6fcc37557db377d3081074a3cb05b7cc0408d13a94a72bc7eb8ccf7ba019f7aea3df3a66701f24e079f807a5f2a745f4129920b90
7
+ data.tar.gz: 62bfc91b53da0207bda75493dacee3b4691f7d2227d4530ed9f63e590f42db5654714b658259ddee5103d5e6b7a9300eea2bc338977c11218fd9785f2a1487b7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- http-errors (0.1.0)
4
+ http-errors (0.1.1)
5
5
  activesupport (~> 5.1)
6
6
 
7
7
  GEM
Binary file
@@ -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
- hash = {
10
- error: error.message,
11
- }
11
+ private
12
12
 
13
- render \
14
- text: error.message,
15
- json: hash,
16
- status: error.status
17
- end
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
@@ -1,3 +1,3 @@
1
1
  module HttpErrors
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-05 00:00:00.000000000 Z
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