Skip to content

Add integration for 'multipleResolves' event #1837

Closed

Description

@iatsiuk

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

@sentry/node@4.5.1

Description

The 'multipleResolves' event is emitted whenever a Promise has been either:

  • Resolved more than once.
  • Rejected more than once.
  • Rejected after resolve.
  • Resolved after reject.

Node.js v11.6.0 Documentation link.

Activity

  1. HazAT commented on Jan 16, 2019

    @HazAT
    Member

    We happily accept PRs for this :)

  2. iatsiuk commented on Jan 16, 2019

    @iatsiuk
    Author

    I don't know TypeScript, sorry for that.

    I'm using this snippet for now:

    process.on('multipleResolves', async (type, promise, value) => {
      let originalVal;
    
      try {
        originalVal = await promise;
      } catch (err) {
        originalVal = err.stack && err.message ? err.message : err;
      }
    
      const swallowedVal = value.stack && value.message ? value.message : value;
      const multipleResolvesError = new Error(
        [
          `Swallowed promise ${type}`,
          `original value: ${JSON.stringify(originalVal)}`,
          `swallowed: ${JSON.stringify(swallowedVal)}.`
        ].join(', ')
      );
    
      Sentry.captureException(multipleResolvesError);
    });
  3. HazAT commented on Jan 16, 2019

    @HazAT
    Member

    This is already really helpful, thanks 💯
    When we find some time we will implement a pluggable integration for this.

  4. locked and limited conversation to collaborators on Jan 26, 2023
  5. converted this issue into a discussion #6940 on Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions