Skip to content

Commit 0dcc47c

Browse files
YunchuWangCopilot
andcommitted
Align getStatus not-found message with v3 wording (review item 5)
v3 DurableClient.getStatus throws on the extension's HTTP 404 with 'This usually means we could not find any data associated with the instanceId provided: <id>.'. Mirror that sentence verbatim (only the HTTP-404-specific first sentence is replaced, since the gRPC path has no HTTP 404). Update the not-found tests to assert the v3 message. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 900064f commit 0dcc47c

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

packages/azure-functions-durable/src/client.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,12 @@ export class DurableFunctionsClient extends TaskHubGrpcClient {
230230
async getStatus(instanceId: string, options?: GetStatusOptions): Promise<DurableOrchestrationStatus> {
231231
const state = await this.getOrchestrationState(instanceId, true);
232232
if (state === undefined) {
233+
// Mirror v3's DurableClient.getStatus not-found behavior: it throws (its case-404 branch) with
234+
// this message shape. The gRPC path has no HTTP 404, so only the extension-specific first
235+
// sentence is replaced; the instanceId-bearing sentence is kept verbatim.
233236
throw new Error(
234-
`DurableClient error: No orchestration instance with ID '${instanceId}' was found. ` +
235-
`This usually means no data is associated with the provided instanceId.`,
237+
`DurableClient error: No orchestration instance found. ` +
238+
`This usually means we could not find any data associated with the instanceId provided: ${instanceId}.`,
236239
);
237240
}
238241
let history: unknown[] | undefined;

packages/azure-functions-durable/test/unit/client-query.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ describe("DurableFunctionsClient query methods", () => {
6060
const client = new DurableFunctionsClient(CLIENT_CONFIG);
6161
try {
6262
jest.spyOn(client, "getOrchestrationState").mockResolvedValue(undefined);
63-
await expect(client.getStatus("missing")).rejects.toThrow(/No orchestration instance with ID 'missing'/);
63+
await expect(client.getStatus("missing")).rejects.toThrow(
64+
/could not find any data associated with the instanceId provided: missing/,
65+
);
6466
} finally {
6567
await client.stop();
6668
}

packages/azure-functions-durable/test/unit/client.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ describe("DurableFunctionsClient", () => {
321321
const client = new DurableFunctionsClient(CLIENT_CONFIG);
322322
try {
323323
jest.spyOn(client, "getOrchestrationState").mockResolvedValue(undefined);
324-
await expect(client.getStatus("missing")).rejects.toThrow(/No orchestration instance with ID 'missing'/);
324+
await expect(client.getStatus("missing")).rejects.toThrow(
325+
/could not find any data associated with the instanceId provided: missing/,
326+
);
325327
} finally {
326328
await client.stop();
327329
}

0 commit comments

Comments
 (0)