-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented anomaly and exception handle maps #40
Conversation
Awesome will check that soon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only one feature request on this feature 😀
Should this handler map have always keyword keys?
Even if the name a string we can convert it to keyword. It is more idiomatic and we can also directly use that keyword that resolves to a function without problems.
What do you think?
Yes I totally agree to that, strings as keys in the maps didn't feel right. I also think the step names should be allowed to be keywords as well, either strings or keywords. I always write them as keywords and them get an error. That's a different issue tho. I'll implement that tomorrow, now I'm watching Barcelona Man U 😄 ⚽ |
I thought we already allow name to be a string or keyword but I will double check as well |
Yes right now steps must be strings:
I think the proper approach would be to always convert the steps names and handler map keys into keywords. Then the user can use strings or keywords indifferently. What do you think? |
Totally we should do that |
1fa7575
to
a5dccfa
Compare
The fonda.core and fonda.execute have a different specification of the step name key, so we duplicate the step specs, waiting for spec2 to save the boat.
a5dccfa
to
831562e
Compare
Anomaly handlers is map of functions indexed by step name that get called with a map
{:ctx <ctx> :anomaly <anomaly>}
when the step returns an anomaly.Exception handlers is a map of functions indexed by step name that get called with a map
{:ctx <ctx> :exception <exception>}
when the step triggers an exception.Both are given in the configuration map of fonda under
:anomaly-handlers
and:exception-handlers
, and both are optional.