Skip to content

Commit

Permalink
fix: fixes a bug inside the error reporting (#5880)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasholzer authored Jul 19, 2023
1 parent 2c9d8f9 commit f38514a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/utils/telemetry/report-error.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ export const reportError = async function (error, config = {}) {
return
}

// convert a NotifiableError to an error class
// eslint-disable-next-line unicorn/no-nested-ternary
const err = error instanceof Error ? error : typeof error === 'string' ? new Error(error) : error

const globalConfig = await getGlobalConfig()

const options = JSON.stringify({
type: 'error',
data: {
message: error.message,
name: error.name,
stack: error.stack,
cause: error.cause,
message: err.message,
name: err.name,
stack: err.stack,
cause: err.cause,
severity: config.severity,
user: {
id: globalConfig.get('userId'),
Expand Down

2 comments on commit f38514a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,299
  • Package size: 270 MB

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,299
  • Package size: 270 MB

Please sign in to comment.