Skip to content
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

[BUG] error logging an error--need to null-check reason #1610

Closed
JohnnyFun opened this issue Jul 14, 2021 · 3 comments
Closed

[BUG] error logging an error--need to null-check reason #1610

JohnnyFun opened this issue Jul 14, 2021 · 3 comments
Assignees
Milestone

Comments

@JohnnyFun
Copy link

Description/Screenshot
We receive some errors in our insights "undefined is not an object (evaluating 't.reason.toString')". That line of error-handling code just probably needs to not assume reason is there and maybe fallback to message or something?

Steps to Reproduce
Not sure what underlying error is, but it'd be an error without a reason property somehow. The error came from Mac OS X 10.13 Safari 12.1, so that might have something to do with it.

  • SDK Version [e.g. 22]: 2.6.2
  • How you initialized the SDK:
appInsights = new ApplicationInsights({
    config: {
      instrumentationKey,
      enableUnhandledPromiseRejectionTracking: true,
      // We only want to log errors for debugging.
      disableAjaxTracking: true,
      disableFetchTracking: true,
    },
  })

  appInsights.loadAppInsights()

  appInsights.addTelemetryInitializer(item => {
    const customDimensions = buildCustomDimensions(true)
    const props = (item.baseData.properties = item.baseData.properties || {})
    for (const key in customDimensions) props[key] = customDimensions[key]
  })
@MSNev
Copy link
Collaborator

MSNev commented Jul 14, 2021

Agree, this looks like it occurring within the onunhandledrejection promise handler.

@MSNev
Copy link
Collaborator

MSNev commented Aug 9, 2021

v2.6.5 is now fully deployed

@MSNev MSNev closed this as completed Aug 9, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants