aws-samples / aws-cdk-examples

Example projects using the AWS CDK
Apache License 2.0
4.95k stars 2.1k forks source link

Remove unnecessary process.exit(1); after throw new Error() #1019

Closed GitSumito closed 3 months ago

GitSumito commented 3 months ago

This pull request removes the process.exit(1);

statement that follows the throw new Error('Unknown Engine Please Use mysql or postgresql'); line. The process.exit(1); is unnecessary because once an error is thrown, the execution of the code is halted, and the process.exit(1); will never be reached.

By removing the process.exit(1); statement, we can improve the code readability and maintain consistency with the error handling mechanism in the AWS CDK stack definition file. The throw new Error() statement is sufficient to handle the error and stop the execution of the code when an unknown engine is encountered.