Skip to content

Commit 17d502d

Browse files
torosentCopilot
andcommitted
fix: don't overwrite specific error message in catch path
Address review feedback from @YunchuWang: in the catch block, setSpanError sets the span with the actual exception message, but setOrchestrationStatusFromActions would then overwrite it with a generic 'Orchestration failed' because the synthesized action has undefined result. Now the catch path sets the status attribute directly without calling setOrchestrationStatusFromActions, preserving the specific error message. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9fe928c commit 17d502d

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

packages/durabletask-js/src/worker/task-hub-grpc-worker.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { VersioningOptions, VersionMatchStrategy, VersionFailureStrategy } from
2525
import { compareVersions } from "../utils/versioning.util";
2626
import * as WorkerLogs from "./logs";
2727
import {
28+
DurableTaskAttributes,
2829
startSpanForOrchestrationExecution,
2930
startSpanForTaskExecution,
3031
processActionsForTracing,
@@ -705,6 +706,9 @@ export class TaskHubGrpcWorker {
705706
// Record the failure on the tracing span
706707
if (tracingResult) {
707708
setSpanError(tracingResult.span, error);
709+
// Set just the status attribute — don't call setOrchestrationStatusFromActions
710+
// which would overwrite the specific error message with a generic one
711+
tracingResult.span.setAttribute(DurableTaskAttributes.TASK_STATUS, "Failed");
708712
}
709713

710714
const failureDetails = pbh.newFailureDetails(error);
@@ -718,11 +722,6 @@ export class TaskHubGrpcWorker {
718722
),
719723
];
720724

721-
// Set orchestration status on the span for the failure path too
722-
if (tracingResult) {
723-
setOrchestrationStatusFromActions(tracingResult.span, actions);
724-
}
725-
726725
res = new pb.OrchestratorResponse();
727726
res.setInstanceid(req.getInstanceid());
728727
res.setCompletiontoken(completionToken);

0 commit comments

Comments
 (0)