-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
copilot-findsFindings from daily automated code review agentFindings from daily automated code review agent
Description
Problem
getHostAddress() in DurableTaskAzureManagedClientOptions (packages/durabletask-js-azuremanaged/src/options.ts, line 104) catches URL parsing errors and re-throws a new Error with a descriptive message, but drops the original error. This makes it difficult to diagnose why a specific endpoint URL is invalid (e.g., invalid characters, malformed port, encoding issues).
// Current code (line 104-105)
} catch {
throw new Error(`Invalid endpoint URL: ${endpoint}`);
}Root Cause
The catch block does not bind the caught error and does not pass it as the cause property of the new Error. This pattern is inconsistent with the rest of the codebase — for example, pb-helper.util.ts:434 correctly uses { cause: err } when wrapping parsing errors.
Proposed Fix
Change the catch block to preserve the original error as the cause:
} catch (e) {
throw new Error(`Invalid endpoint URL: ${endpoint}`, { cause: e });
}Impact
- Severity: Low-medium. Does not affect runtime behavior, but degrades debuggability when users configure invalid endpoint URLs.
- Affected scenarios: Any use of
DurableTaskAzureManagedClientBuilderorDurableTaskAzureManagedWorkerBuilderwith an invalid endpoint URL. - Cross-SDK alignment: The
{ cause }pattern is the established error wrapping convention in this codebase.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
copilot-findsFindings from daily automated code review agentFindings from daily automated code review agent