Add integration for 'multipleResolves' event #6940
                  
                    
                      iatsiuk
                    
                  
                
                  started this conversation in
                Features / New SDKs (Integrations) / Ideas
              
            Replies: 3 comments
-
| We happily accept PRs for this :) | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| 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);
}); | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| This is already really helpful, thanks 💯 | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Package + Version
@sentry/browser@sentry/noderaven-jsraven-node(raven for node)Version:
Description
The 'multipleResolves' event is emitted whenever a Promise has been either:
Node.js v11.6.0 Documentation link.
Beta Was this translation helpful? Give feedback.
All reactions