Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(all): disallow throwing literals (@typescript-eslint/no-throw-literal) #3086

Merged
merged 6 commits into from Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/api/cli/src/util/terminate.ts
Expand Up @@ -7,7 +7,6 @@ function redConsoleError(msg: string) {
process.on('unhandledRejection', (reason: string, promise: Promise<unknown>) => {
redConsoleError('\nAn unhandled rejection has occurred inside Forge:');
redConsoleError(reason.toString().trim());
redConsoleError('\nElectron Forge was terminated. Location:');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just an unnecessary log line

promise.catch((err: Error) => {
if ('stack' in err) {
const usefulStack = err.stack;
Expand Down
9 changes: 2 additions & 7 deletions packages/api/core/src/api/make.ts
Expand Up @@ -282,15 +282,10 @@ export const listrMake = (
arch: targetArch,
});
} catch (err) {
if (err instanceof Error) {
throw {
message: `An error occured while making for target: ${maker.name}`,
stack: `${err.message}\n${err.stack}`,
};
} else if (err) {
if (err) {
throw err;
} else {
throw new Error(`An unknown error occured while making for target: ${maker.name}`);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo fix

throw new Error(`An unknown error occurred while making for target: ${maker.name}`);
}
}
},
Expand Down