Skip to content

Commit a9f13c2

Browse files
Merge staging into feature/lambda-get-started
2 parents 0f9cf35 + 7ec1e5d commit a9f13c2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/core/src/shared/errors.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,15 @@ export function isClientFault(error: ServiceException): boolean {
459459
return error.$fault === 'client' && !(isThrottlingError(error) || isTransientError(error))
460460
}
461461

462-
export function getRequestId(error: unknown): string | undefined {
463-
if (isAwsError(error)) {
464-
return error.requestId
462+
export function getRequestId(err: unknown): string | undefined {
463+
if (isAwsError(err)) {
464+
return err.requestId
465465
}
466466

467-
if (error instanceof ServiceException) {
468-
return error.$metadata.requestId
467+
// XXX: Checking `err instanceof ServiceException` fails for `SSOOIDCServiceException` even
468+
// though it subclasses @aws-sdk/smithy-client.ServiceException
469+
if (typeof (err as any)?.$metadata?.requestId === 'string') {
470+
return (err as any).$metadata.requestId
469471
}
470472
}
471473

0 commit comments

Comments
 (0)