Closed brianvh closed 8 years ago
I think that makes a lot of sense. I also like the consistency of it being a guard. If it becomes a guard though, it seems that if it fails it would either be false
or with a hard transition is would raise GuardFailed
. So we still wouldn't have an error specific to missing params. Maybe that's ok.
I think I'm good wither either solution. Either it turns into a built in guard and acts like any other guard (and it should be the first guard) or it stays how it is but on failure it tosses a new MissingParams
error instead of a more generic one.
Feel free to submit a PR with the one you like best.
Cool. I think my plan is to go with the added error class, at least for a first pass. While I still think a form of Guard will eventually be the more correct solution, I also think there are several unknowns that I'm not sure I have the time to devote to, just now...
This was address in #34 and included in v1.1.0
I just noticed that even though there's a fairly robust set of
EndState::Error
subclasses, it looks like the error raised whenrequire_params
are missing is just the basicRuntimeError
. This makes it very difficult to specify arescue
clause that only fires whenrequire_params
fails.As I was mapping out the changes that an
EndState::MissingParams
subclass would need, it also occurred to me thatrequire_params
should work like a Guard, in the same waypersistence_on
works like a Concluder. And that theMissingParams
error should only be raised during ahard
transition.Thoughts?