rescue_registry 0.2.4 → 0.2.5

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: '059708756e6a55e037d23bea568cfe2d58818204d21da641b15a824eeed8aeb6'
4
- data.tar.gz: 72f2989656beee1dd63caff80fde2808d9ad82aa36e2d5f48c9ada3eda529fab
3
+ metadata.gz: 237133f9678393d12439ef50317b1671632606d3d35a7b5f658cf4eab3083bbc
4
+ data.tar.gz: ffac90b369e7b345fd74de72db7178f420b9577ca30e26d1b8427cf2e58049e4
5
5
  SHA512:
6
- metadata.gz: 6c40c4d7c189ed217216eca7f37ab81d3fc7bf9ae906a868e0e676f11e7384f67125e8d305bf55db75284ec5b37d70355719dbfee4cd2b72f009229238bcd154
7
- data.tar.gz: de9fb10f2fd414e44b7a50be904505bb42889088ab71d76ec34f004501b297996018cd398629c6f78cea17f9fbfad77f79a530be4e0b2ee8c8b93fb2c0787888
6
+ metadata.gz: 43d1e9755b0333d69646594e28e6caef2219e02b9a18d466fd8bee0b204d4fefdc817628d958899abe8e6391327a5a9f131889ea0ee44ac611e778d5a1f3d70c
7
+ data.tar.gz: 54dcad7d3ad63eec2dd5c752cafff76ff248832093603f45e1c0c959e10b8e62dcc9102e1823a163b5c6452022ab6fc3f2ed8ac5267cbcc52290916092329b6f
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.2.5] - 2021-03-09
11
+ ### Added
12
+ - `code` can now be provided as an argument to `register_exception` - #29 (thanks @amaierhofer)
13
+
14
+ ## [0.2.4] - 2021-01-22
15
+ ### Fixed
16
+ - Support Ruby 3 (thanks @zvkemp and @ef4)
17
+
10
18
  ## [0.2.3] - 2020-09-01
11
19
  ### Fixed
12
20
  - Properly handle exceptions for invalid format types - #25 (thanks @shanet)
data/README.md CHANGED
@@ -58,6 +58,7 @@ class MyController < ActionController::Base
58
58
  register_exception MetaProcError, meta: -> (e) { { class_name: e.class.name.upcase } }
59
59
  register_exception CustomHandlerError, handler: CustomErrorHandler
60
60
  register_exception RailsError, status: 403, handler: RescueRegistry::RailsExceptionHandler
61
+ register_exception CustomStatusError, status: 422, code: :name_invalid
61
62
  end
62
63
  ```
63
64
 
@@ -21,6 +21,7 @@ module RescueRegistry
21
21
  end
22
22
 
23
23
  @meta = options[:meta]
24
+ @code = options[:code]
24
25
 
25
26
  # TODO: Warn about unrecognized options
26
27
  end
@@ -29,7 +30,7 @@ module RescueRegistry
29
30
  alias_method :status_code, :status
30
31
 
31
32
  def error_code
32
- error_code_from_status
33
+ @code.presence || error_code_from_status
33
34
  end
34
35
 
35
36
  def title
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RescueRegistry
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rescue_registry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Wagenet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-22 00:00:00.000000000 Z
11
+ date: 2021-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubygems_version: 3.1.4
135
+ rubygems_version: 3.2.3
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: Registry for Rails Exceptions