Skip to content

Commit

Permalink
cleanup error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Jul 17, 2023
1 parent 6f0d55e commit 1fcbd2b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ main(async () => {
);

const failureCount = Object.values(result).reduce((count, result) => {
if (!result.success) return count++;
else return count;
if (!result.success) {
logger.error(result.err);
return count++;
}
return count;
}, 0);

process.exit(failureCount);
Expand Down
2 changes: 1 addition & 1 deletion src/stores/edge-addon-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class EdgeAddonStore implements IStore {
} while (operation.status === 'InProgress');

if (operation.status === 'Failed') {
this.deps.logger.error(`Validation Failed: ${operation.message}`);
throw Error(`Validation failed: ${operation.message}`);
} else {
this.log('Extension is valid: ' + operation.message);
}
Expand Down
2 changes: 1 addition & 1 deletion src/stores/firefox-addon-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class FirefoxAddonStore implements IStore {
)}, ${plural(notices, 'notice')}`,
);
if (!upload.valid) throw Error(`Extension is invalid: ${validationUrl}`);
else this.log(`Validation results available at: ${validationUrl}`);
else this.log(validationUrl);
}

private async uploadAndPollValidation(
Expand Down

0 comments on commit 1fcbd2b

Please sign in to comment.