Skip to content

Commit fe771d5

Browse files
author
Vieltojarvi
committed
fix: update to error
1 parent f5a6892 commit fe771d5

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/amplify-cli/src/__tests__/serializable-error.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('test serializabe error', () => {
6767

6868
it('test SerializeError error message has no home directories in file paths', () => {
6969
const error = new AmplifyError('FileSystemPermissionsError', {
70-
message: `Permission denied, open '${os.homedir()}/.amplify/logs/amplify-cli.log`,
70+
message: `Permission denied, open '${os.homedir()}/.amplify/logs/amplify-cli-10371230.log`,
7171
});
7272

7373
const serializableError = new SerializableError(error);

packages/amplify-cli/src/domain/amplify-usageData/SerializableError.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,10 @@ const removeStackIdentifier = (str?: string): string | undefined => {
108108
};
109109

110110
const anonymizePaths = (str: string): string => {
111-
const result = str;
112-
const matches = [...result.matchAll(filePathRegex)];
111+
let result = str;
113112

114-
for (const match of matches) {
115-
result.replace(match[0], processPaths([match[0]])[0]);
113+
if (result.match(filePathRegex)) {
114+
result = result.replaceAll(filePathRegex, '');
116115
}
117116

118117
return result;

0 commit comments

Comments
 (0)