temporal icon indicating copy to clipboard operation
temporal copied to clipboard

New error type for workflow already completed?

Open yycptt opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. For both workflow not found and workflow already completed case, we return a NotFound error. And caller can't tell the which case it is just by checking the error type if it wants to have different error handling logic for those two cases.

An example is verifying child workflow recorded. If parent not found, we need to keep retrying the verification. If parent already completed, the verification doesn't need to continue. Currently the implementation is return WorkflowNotReady error if workflow not found and return NotFound when workflow already completed. This makes the error handling logic very confusing.

In this particular case of verification, we probably don't have to return already completed error at all. Basically assume this error will always be ignored by caller. (The idea of current implementation is simply gave more accurate information to the caller and don't make any assumption on the caller). Then NotFound can either be unexpected or only means the real workflow not found.

Is there any other cases where we need to treat not found and already completed differently?

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

yycptt avatar Jul 05 '22 23:07 yycptt