@atlassian/wrm-troubleshooting
Version:
A tool that can help you with troubleshooting the configuration of webpack and Atlassian P2 project.
21 lines • 634 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAsyncHandler = getAsyncHandler;
/**
* This function will wrap a yargs handler command with try/catch.
* The async will catch any error, display error message, and exist with error code
*/
function getAsyncHandler(handler) {
return async function asyncHandler(options) {
try {
await handler(options);
process.exit(0);
}
catch (err) {
const error = err;
console.log(error.message);
process.exit(1);
}
};
}
//# sourceMappingURL=yargsHelper.js.map