Skip to content

fix: Set transaction on scope in node for request #2769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ jobs:
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- uses: actions/download-artifact@v2
with:
name: build
path: ${{ github.workspace }}/packages
- uses: andresz1/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: echo "doing nothing"
skip_step: install
skip_step: build

job_lint:
name: Lint
Expand Down
5 changes: 5 additions & 0 deletions packages/node/src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down