Skip to content

Commit

Permalink
Move Sentry capture up stack
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhobbs committed Oct 1, 2024
1 parent d941f61 commit d6f1e9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions node-src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ async function runBuild(ctx: Context) {
await new Listr(getTasks(ctx.options), options).run(ctx);
ctx.log.debug('Tasks completed');
} catch (err) {
Sentry.captureException(err);
endActivity(ctx);
if (err.code === 'ECONNREFUSED' || err.name === 'StatusCodeError') {
setExitCode(ctx, exitCodes.FETCH_ERROR);
Expand Down Expand Up @@ -266,8 +267,6 @@ async function runBuild(ctx: Context) {
ctx.log.flush();
}
} catch (error) {
Sentry.captureException(error);

const errors = [error].flat(); // GraphQLClient might throw an array of errors
const formattedError = fatalError(ctx, errors);

Expand Down

0 comments on commit d6f1e9d

Please sign in to comment.