rescue_registry 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/rescue_registry/exception_handler.rb +13 -7
- 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: a1680176387616a079a616679ca436f7e1a81ff266c1a6d8d574caa71e6ccab7
|
4
|
+
data.tar.gz: 329c59744d4fc5eddb2a1d91fc3049df660966a54b13625b667e4085b59daeb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f174ee373dc0352d366bb4e4ad6deedd95185600e904db85fe472622765e0726e6c07678de7f28c002cf5e39279725bc3400f5db105acb81254a20acb0945acb
|
7
|
+
data.tar.gz: a3f82a0a1b907baf038cb274a0fb8d7fbb4198e49dc9f5d6b49aee417b782c22dedd03cb17bf8d314f6507f6faf40cb7dc0928871d1a44d3af81f9692b9305e2
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
---
|
9
9
|
|
10
|
+
## [0.3.0] - 2021-05-11
|
11
|
+
### Changed
|
12
|
+
- For better JSONAPI spec compliance, errors payloads will not include the `details` key when value is `null`.
|
13
|
+
- Error payloads will not include the `meta` key when value is an empty object.
|
14
|
+
|
10
15
|
## [0.2.5] - 2021-03-09
|
11
16
|
### Added
|
12
17
|
- `code` can now be provided as an argument to `register_exception` - #29 (thanks @amaierhofer)
|
@@ -75,14 +75,20 @@ module RescueRegistry
|
|
75
75
|
)
|
76
76
|
end
|
77
77
|
|
78
|
+
error_payload = {
|
79
|
+
code: error_code,
|
80
|
+
status: status_code.to_s,
|
81
|
+
title: title
|
82
|
+
}
|
83
|
+
|
84
|
+
if (d = detail)
|
85
|
+
error_payload[:detail] = d
|
86
|
+
end
|
87
|
+
|
88
|
+
error_payload[:meta] = payload_meta if payload_meta.any?
|
89
|
+
|
78
90
|
{
|
79
|
-
errors: [
|
80
|
-
code: error_code,
|
81
|
-
status: status_code.to_s,
|
82
|
-
title: title,
|
83
|
-
detail: detail,
|
84
|
-
meta: payload_meta
|
85
|
-
]
|
91
|
+
errors: [error_payload]
|
86
92
|
}
|
87
93
|
end
|
88
94
|
|
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.
|
4
|
+
version: 0.3.0
|
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-05-11 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.2.
|
135
|
+
rubygems_version: 3.2.15
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Registry for Rails Exceptions
|