Skip to content

Commit

Permalink
instances of error.code were changed to error.name incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealAmazonKendra committed Oct 4, 2024
1 parent 8f7b25c commit 66ed30f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk/lib/api/aws-auth/account-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class AccountAccessKeyCache {
} catch (e: any) {
// File doesn't exist or is not readable. This is a cache,
// pretend we successfully loaded an empty map.
if (e.name === 'ENOENT' || e.name === 'EACCES') {
if (e.code === 'ENOENT' || e.code === 'EACCES') {
return {};
}
// File is not JSON, could be corrupted because of concurrent writes.
Expand All @@ -100,7 +100,7 @@ export class AccountAccessKeyCache {
} catch (e: any) {
// File doesn't exist or file/dir isn't writable. This is a cache,
// if we can't write it then too bad.
if (e.name === 'ENOENT' || e.name === 'EACCES' || e.name === 'EROFS') {
if (e.code === 'ENOENT' || e.code === 'EACCES' || e.code === 'EROFS') {
return;
}
throw e;
Expand Down
1 change: 0 additions & 1 deletion packages/aws-cdk/test/account-cache.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/order */
import * as path from 'path';
import * as fs from 'fs-extra';
import { withMocked } from './util';
Expand Down

0 comments on commit 66ed30f

Please sign in to comment.