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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -0
- data/lib/rescue_registry/exception_handler.rb +2 -1
- data/lib/rescue_registry/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 237133f9678393d12439ef50317b1671632606d3d35a7b5f658cf4eab3083bbc
|
4
|
+
data.tar.gz: ffac90b369e7b345fd74de72db7178f420b9577ca30e26d1b8427cf2e58049e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
+
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-
|
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.
|
135
|
+
rubygems_version: 3.2.3
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Registry for Rails Exceptions
|