Merge pull request #1590 from balena-io/remove-unnecessary-code

Remove unnecessary code now that typescript understands `process.exit`
This commit is contained in:
Page- 2020-02-04 10:31:23 +00:00 committed by GitHub
commit 405b92114d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 4 deletions

View File

@ -31,7 +31,6 @@ import { fixPathForMsys, ROOT, runUnderMsys } from './utils';
function exitWithError(error: Error | string): never {
console.error(`Error: ${error}`);
process.exit(1);
throw error; // to please the Typescript compiler
}
/**

View File

@ -58,7 +58,7 @@ function setupRaven() {
release: require('../package.json').version,
}).install(function(_logged: any, error: Error) {
console.error(error);
return process.exit(1);
process.exit(1);
});
Raven.setContext({

View File

@ -454,6 +454,4 @@ export function exitWithExpectedError(message: string | Error): never {
printErrorMessage(message);
process.exit(1);
// The following throw is to make tsc happy about the `never` return type.
throw new Error('exit');
}