question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extended Error Info

See original GitHub issue

When we notify an error to bugsnag using bugsnag.notify(error), by default it shows Error name, stack trace and message in Bugsnag App.

If the error is a custom Error (extended), which may include more info, that data is not visible anywhere (not sure if it’s captured in the first place).

For example, consider following error class -

EError.js

module.exports = class EError extends Error {
    constructor (message, statusCode, details) {
        super(message);
        this.statusCode = statusCode || 500;
        this.details = details;
        this.name = "EError" + (statusCode ? ` (${statusCode})` : "");
    }
};

I have 2 additional properties statusCode and details, which I want to be included in Bugsnag error. If I pass the error (instanceof EError) to bugsnag notify, the extra properties are no where to be found in the captured Bugsnag error.

let details = { sess: "7e5c1c4a-11e3-41a2-a935-c1a0068e521b" };
let err = new EError("Bad Email Address", 400, details);
bugsnag.notify(err);

I tried pushing the err as metaData, even then the details and statusCode is no where to be found on bugsnag.

bugsnag.notify(err, { metaData: {err} }); 

Only message and name captured in metadata.

What can I do to capture more info about the error. Not just that this custom error class has more info, most of the libraries has custom error with more details where message would not be sufficient to debug error. E.g check Sequelize Unique Constraint Error, it has so many info which is just lost when captured on Bugsnag.

I’m currently on v6.2.0 of @bugsnag/node (using with NodeJS v8.11.1)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
luke-beltoncommented, Jul 15, 2022

Hi @GuillaumeCisco - please could you expand a bit more on this please? Are you able to share a code snippet or a link to an event in your Bugsnag dashboard to demonstrate what you mean? Feel free to write into support@bugsnag.com if you’d prefer 👍

1reaction
gaastonsrcommented, Nov 27, 2019

Agree with @enVolt here, getting all the extra enumerable properties from the Error object should be the default and it shouldn’t be complex or error prone. Knowing how to handle Error objects properly is something I would expect out of the box.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enabling Extended Error Information - Win32 apps
To enable extended error information, take the following steps: Open the local machine policy using the gpedit.msc interface.
Read more >
Requesting Extended Error Information - IBM
You can request that EXCP and EXCPVR processing return extended error information. This extended error information consists of sense information, ...
Read more >
Extended error occurred | ManageEngine Endpoint Central
Extended error has occurred · Problem · Cause · Resolution · Try using an IP Address based share path instead of the UNC...
Read more >
Extended DNS Errors RFC 8914 - IETF Datatracker
Extended DNS Errors (RFC 8914, October 2020)
Read more >
Extended error codes
As a service to you, we have added these codes to our software to provide you with as much information as possible to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found