axn 0.1.0.pre.alpha.2.5.3 → 0.1.0.pre.alpha.2.5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/docs/reference/class.md +5 -5
- data/lib/axn/testing/spec_helpers.rb +0 -2
- data/lib/axn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d67c51bf6cef09cdbfb8246769eefb7c9b1baa3f7d75168d599f898d66d00157
|
4
|
+
data.tar.gz: 06d6b82b58b9a65bd1d8da9e68a8a640a5fcf0e1dafdbd5d756ea1d1682f7e95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a656fe06eec316eb1c974586adec336afe6f09257da62f88789f467fe06f0f3677249fccb1aec7dd83c3328c1cc0ee505640e786b1892338ff0be71723b758c3
|
7
|
+
data.tar.gz: 337a92138da80dcf5e00947b4cb00589d689e1dc6dae3340d91e76874e4a335feb3a1ef254c3e6220c6a0d271f49fe8f77f9deea5d731ed1caa3f3c4317c1b42
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
## Unreleased
|
4
4
|
* N/A
|
5
5
|
|
6
|
+
## 0.1.0-alpha.2.5.3.1
|
7
|
+
* Remove explicit 'require rspec' from `axn/testing/spec_helpers` (must already be loaded)
|
8
|
+
|
6
9
|
## 0.1.0-alpha.2.5.3
|
7
10
|
* More aggressive logging of swallowed exceptions when not in production mode
|
8
11
|
* Make automatic pre/post logging more digestible
|
data/docs/reference/class.md
CHANGED
@@ -95,11 +95,11 @@ Accepts `error` and/or `success` keys. Values can be a string (returned directl
|
|
95
95
|
messages success: "All good!", error: ->(e) { "Bad news: #{e.message}" }
|
96
96
|
```
|
97
97
|
|
98
|
-
## `
|
98
|
+
## `error_from` and `rescues`
|
99
99
|
|
100
100
|
While `.messages` sets the _default_ error/success messages and is more commonly used, there are times when you want specific error messages for specific failure cases.
|
101
101
|
|
102
|
-
`
|
102
|
+
`error_from` and `rescues` both register a matcher (exception class, exception class name (string), or callable) and a message to use if the matcher succeeds. They act exactly the same, except if a matcher registered with `rescues` succeeds, the exception _will not_ trigger the configured exception handlers (global or specific to this class).
|
103
103
|
|
104
104
|
```ruby
|
105
105
|
messages error: "bad"
|
@@ -108,8 +108,8 @@ messages error: "bad"
|
|
108
108
|
rescues ActiveRecord::InvalidRecord => "Invalid params provided"
|
109
109
|
|
110
110
|
# These WILL trigger error handler (second demonstrates callable matcher AND message)
|
111
|
-
|
112
|
-
|
111
|
+
error_from ArgumentError, ->(e) { "Argument error: #{e.message}" }
|
112
|
+
error_from -> { name == "bad" }, -> { "was given bad name: #{name}" }
|
113
113
|
```
|
114
114
|
|
115
115
|
## Callbacks
|
@@ -153,7 +153,7 @@ class Foo
|
|
153
153
|
end
|
154
154
|
```
|
155
155
|
|
156
|
-
Note that by default the `on_exception` block will be applied to _any_ `StandardError` that is raised, but you can specify a matcher using the same logic as for [`
|
156
|
+
Note that by default the `on_exception` block will be applied to _any_ `StandardError` that is raised, but you can specify a matcher using the same logic as for [`error_from` and `rescues`](#error-for-and-rescues):
|
157
157
|
|
158
158
|
```ruby
|
159
159
|
class Foo
|
data/lib/axn/version.rb
CHANGED