You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second argument to `#on_failure` is the method name that defines the
whole operation, not the step that failed. This is because a single
class can define multiple operations.
Copy file name to clipboardExpand all lines: docsite/source/error-handling.html.md
+2-9Lines changed: 2 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ class CreateUser < Dry::Operation
34
34
end
35
35
```
36
36
37
-
The `#on_failure` method can optionally accept a second argument that indicates which method encountered the failure, allowing youmore granular control over error handling:
37
+
The `#on_failure` method can optionally accept a second argument that indicates which method encountered the failure. This is helpful if you're defining more than an operation in a class:
38
38
39
39
```ruby
40
40
classCreateUser < Dry::Operation
@@ -52,14 +52,7 @@ class CreateUser < Dry::Operation
0 commit comments