As title, the Cause(ctx) is in the internal package.
func Workflow(ctx workflow.Context, input string) (string, error) {
ctx, cancel := workflow.WithCancelCause(ctx)
cancel(errors.New("This workflow is canceled"))
return "", ctx.Err()
}
This will get context cancelled error in client.GetWorkflowResult
To get the underling error correctly... it should be
func Workflow(ctx workflow.Context, input string) (string, error) {
ctx, cancel := workflow.WithCancelCause(ctx)
cancel(errors.New("This workflow is canceled"))
return "", workflow.Cause(ctx.Err())
}
But workflow.Cause is not exposed in this library, so not possible to get the underlying error.
As title, the
Cause(ctx)is in the internal package.This will get
context cancellederror inclient.GetWorkflowResultTo get the underling error correctly... it should be
But
workflow.Causeis not exposed in this library, so not possible to get the underlying error.