confused about Error Handling #569
Replies: 6 comments 13 replies
-
In SW we opted to go with domain-specific error handling in order for it to be portable between different runtimes written in different languages and using different libraries etc etc. There has to be a layer of custom mapping on a runtime side between the name/code of an error definition in the DSL and an actual error/exception that the runtime catches when doing things like handling timeouts/performing function invocations in whatever shape/form and stuff like that. So for example in DSL if you have:
Runtime impls should have a mapping that maps the name and/or code defined here to a particular exception, for example in this case could be mapped to idk, a GoogleJsonResponseException that has a statusCode of 503. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/serverlessworkflow/specification/blob/main/schema/errors.json#L49 -> only name is required param. |
Beta Was this translation helpful? Give feedback.
-
I don't think that the same name for an error is of issue as you define The missing part is having In addition I am also wonder why there is retries on action but not on state? Seems like it got bit mixed up since 0.6 (that I was looking into last time or I simply missed some important reasons for that). Would it make sense to unify both? by that I mean:
With that I think we should have most of the use cases covered without limits. What do you guys think? |
Beta Was this translation helpful? Give feedback.
-
don't know if i'd like to tie retry reference to an error definition in the dsl. they should be able to be defined individually and reused individually. |
Beta Was this translation helpful? Give feedback.
-
one additional thought that there is no way (at least as far as I understand it) to define retry logic on state as If that's the case it is another argument to unify |
Beta Was this translation helpful? Give feedback.
-
Here's our new take on the error handling in the new DSL if you want to explore: https://github.com/serverlessworkflow/specification/blob/main/dsl.md#fault-tolerance |
Beta Was this translation helpful? Give feedback.
-
There is
OnError
in the various States with fieldsOnError.ErrorRef/s
. I understand thaterrorRefs
point to theWorkflow.Errors
. I am unsure how thisWorkflow.Errors
is to be used.I am thinking that when an
Action
returns an error, i just check against the State'sOnError.ErrorRef
and if found, i would just handle the resulting Transition or End. Or am i supposed to take the error code returned by theAction
and match it againstWorkflow.Errors.Code
to convert a code into an unique error-name? if so, isWorkflow.Errors.Code
supposed to be unique?If
Workflow.Errors.Code
is supposed to be unique, then it seems rather difficult to distinguish "404" (as in the example) which may be returned by different servers or external endpointsBeta Was this translation helpful? Give feedback.
All reactions