-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add arguments to exceptions risen by stubbed methods
Use the following syntax: ```yaml --- - class: API chain: find_product arguments: - 1 actions: - raise: API::NotFound arguments: # <-- The new option - "Product with id: 1 not found" ``` In this case the following exception will be risen: ```ruby raise API::NotFoundError.new("Product with id: 1 not found") ``` You can add more arguments to custom errors as well.
- Loading branch information
Showing
4 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ | |
- 0 | ||
actions: | ||
- raise: ArgumentError | ||
arguments: | ||
- Something got wrong | ||
|
||
- class: Payment | ||
chain: | ||
|