-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
When attempting to set ServiceException
props (e.g. $metadata
, $fault
etc) via the constructor, I find I have no problem until I try to set $retryable
. All other values seem to be initialized in the constructor but not $retryable
.
This is reproducible with the following nodejs code:
import assert from "node:assert";
import { ServiceException } from "@smithy/smithy-client";
const error = new ServiceException({
name: "TestError",
$metadata: { httpStatusCode: 200 },
$fault: "client",
$retryable: {},
});
assert.equal("TestError", error.name); // Ok
assert.deepStrictEqual({ httpStatusCode: 200 }, error.$metadata); // Ok
assert.equal("client", error.$fault); // Ok
assert.deepStrictEqual({}, error.$retryable, "Retryable does not match"); // Fails
Which produces the following:
node:internal/modules/run_main:128
triggerUncaughtException(
^
AssertionError [ERR_ASSERTION]: Retryable does not match
+ actual - expected
+ {}
- undefined
...
I couldn't find anything that said if this was an intentional decision or not.
Metadata
Metadata
Assignees
Labels
No labels