Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Flushing with timeout doesn't timeout and eventually crashes  #3806

@Vadorequest

Description

@Vadorequest

Package + Version

  • @sentry/nextjs 6.9.0

Description

Using this code in a Next.js API:

import {captureException, flush, withSentry} from '@sentry/nextjs';

const handler = async () => {
  try {
    throw new Error(
      'This is a fake error meant to help testing Sentry error reporting (monitoring).'
    );
  } catch (e) {
    captureException(e);

    await flush(5000); // Need to flush on API to send errors properly (issue in @sentry/nextjs)
  }
};

export default withSentry(handler);

Calling the API endpoint runs until the Serverless function times out.
Providing a value to flush() doesn't seem to be effective.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nextjsIssues related to the Sentry Nextjs SDK

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions