-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Labels
P2Priority 2 itemPriority 2 item
Description
Describe the bug
When an entity throws an exception, the Error received by the orchestration that called the entity has the message '[object Object]' instead of the error details that were thrown
Investigative information
- Durable Functions extension version: 3.3.0
- durable-functions npm module version: 3.1.0
- Language (JavaScript/TypeScript) and version: TypeScript ^4.0.0
- Node.js version: v22.15.0
If deployed to Azure App Service
N/A
To Reproduce
Steps to reproduce the behavior:
Code:
// Orchestration: CatchEntityOrchestration
const CatchEntityOrchestration: OrchestrationHandler = function* (context: OrchestrationContext) {
const entityId = new df.EntityId("Counter", "myCounter");
try {
yield context.df.callEntity(entityId, "get", context.df.instanceId);
return "Success";
} catch (e: any) {
return String(e);
}
};
df.app.orchestration("CatchEntityOrchestration", CatchEntityOrchestration);
// Entity: Counter
const Counter: EntityHandler<string> = (context: EntityContext<string>) => {
const instanceId = context.df.getInput<string>();
if (!instanceId) {
throw new Error("Did not get a valid instanceId as input to the entity");
}
if (!(instanceId in attemptCount)) {
attemptCount[instanceId] = 1;
const inner = new Error("Inner exception message");
const err = new Error("This entity failed\r\nMore information about the failure");
(err as any).cause = inner;
throw err;
}
attemptCount[instanceId] += 1;
context.df.return(0);
};
df.app.entity("Counter", Counter);
While not required, providing your orchestrator's source code in anonymized form is often very helpful when investigating unexpected orchestrator behavior.
Expected behavior
The "Inner exception message" and "This entity failed..." details should propagate to the orchestrator
Actual behavior
The Error received by the orchestrator has the message '[object Object]'
Screenshots
N/A
Known workarounds
N/A
Additional context
- Development environment (ex. Visual Studio): Visual Studio + Core Tools
Metadata
Metadata
Assignees
Labels
P2Priority 2 itemPriority 2 item