593
attributes,
594
); err != nil {
596
>
597
>
// Check to see if the error is non-transient, in which case add RequestCancelFailed
598
>
// event and complete transfer task by returning nil error.
599
>
if common.IsServiceTransientError(err) || common.IsContextDeadlineExceededErr(err) {
600
// for retryable error just return
601
return err
602
}
604
>
switch err.(type) {
605
>
case *serviceerror.NotFound:
606
>
failedCause = enumspb.CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_EXTERNAL_WORKFLOW_EXECUTION_NOT_FOUND
607
case *serviceerror.NamespaceNotFound:
608
failedCause = enumspb.CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_NAMESPACE_NOT_FOUND