From 7956bd84fac447005682192a04e29aaa95172554 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Thu, 23 Jul 2020 12:58:07 +0200 Subject: [PATCH] fix: Set transaction on scope in node for request (#2769) * fix: Set transaction on scope in node for request * ci: Skip build for size check --- .github/workflows/build.yml | 4 +--- packages/node/src/handlers.ts | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42d607a141eb..18b457143756 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,6 @@ jobs: node_modules */*/node_modules key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - - run: yarn install - uses: actions/download-artifact@v2 with: name: build @@ -53,8 +52,7 @@ jobs: - uses: andresz1/size-limit-action@v1.4.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - build_script: echo "doing nothing" - skip_step: install + skip_step: build job_lint: name: Lint diff --git a/packages/node/src/handlers.ts b/packages/node/src/handlers.ts index b436ded9405d..160db8915d09 100644 --- a/packages/node/src/handlers.ts +++ b/packages/node/src/handlers.ts @@ -407,6 +407,11 @@ export function errorHandler(options?: { if (shouldHandleError(error)) { withScope(_scope => { + // For some reason we need to set the transaction on the scope again + const transaction = (res as any).__sentry_transaction as Span; + if (transaction && _scope.getSpan() === undefined) { + _scope.setSpan(transaction); + } const eventId = captureException(error); (res as any).sentry = eventId; next(error);