-
Notifications
You must be signed in to change notification settings - Fork 91
Closed
Description
I'm not sure this falls inline with your design but I was expecting a guard method to raise an exception when it failed, much like invalid transitions raise errors.
Personally, I don't like a mixture of functionality, either fail hard or use the return value. With guards I need to check the return value (I think) and with invalid state transitions I need to rescue an exception.
Since guards can be multiple response, an exception might be the best solution since it can carry with it which guards failed. This is especially useful for sharing failure state with the end user.
Metadata
Metadata
Assignees
Labels
No labels