From d6f1e9d3da316cc735f102857b9bfe77c3d6c636 Mon Sep 17 00:00:00 2001 From: John Hobbs Date: Mon, 30 Sep 2024 15:44:52 -0500 Subject: [PATCH] Move Sentry capture up stack --- node-src/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/node-src/index.ts b/node-src/index.ts index dd190ff38..9e2c9eacc 100644 --- a/node-src/index.ts +++ b/node-src/index.ts @@ -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); @@ -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);