@magidoc/cli
Version:
Magidoc CLI application responsible for generating GraphQL documentation websites.
24 lines (21 loc) • 591 B
JavaScript
import { printStacktrace, printError, printLine, printInfo } from './log.js';
async function withStacktrace(stacktrace, handler) {
try {
await handler();
}
catch (error) {
process.exitCode = 2;
if (stacktrace) {
printStacktrace(error);
}
else {
if (error instanceof Error) {
printError(error);
}
printLine();
printInfo('For a more detailed output, run with --stacktrace');
}
}
}
export { withStacktrace };
//# sourceMappingURL=withStacktrace.js.map