Skip to content

Commit

Permalink
fix clientContext.getStore() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerbenw committed Aug 29, 2024
1 parent 153bba4 commit fc02f00
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/node/src/notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Object.keys(Client.prototype).forEach((m) => {
Bugsnag[m] = function () {
// if we are in an async context, use the client from that context
let client = Bugsnag._client
if (client && client._clientContext && typeof client._clientContext.getStore === 'function') {
if (client && client._clientContext && client._clientContext.getStore()) {
client = client._clientContext.getStore()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
if (!client._config.enabledErrorTypes.unhandledExceptions) return
_handler = err => {
// if we are in an async context, use the client from that context
const c = (client._clientContext && typeof client._clientContext.getStore === 'function') ? client._clientContext.getStore() : client
const c = (client._clientContext && client._clientContext.getStore()) ? client._clientContext.getStore() : client

// check if the stacktrace has no context, if so append the frames we created earlier
// see plugin-contextualize for where this is created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return
_handler = err => {
// if we are in an async context, use the client from that context
const c = (client._clientContext && typeof client._clientContext.getStore === 'function') ? client._clientContext.getStore() : client
const c = (client._clientContext && client._clientContext.getStore()) ? client._clientContext.getStore() : client

const event = c.Event.create(err, false, {
severity: 'error',
Expand Down

0 comments on commit fc02f00

Please sign in to comment.