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

Error event includes original error #246

Closed
wants to merge 4 commits into from
Closed

Error event includes original error #246

wants to merge 4 commits into from

Conversation

bjyoungblood
Copy link

It would be nice for reporters to have access to the original error in case they want to do something with it.

In my case, I am writing a reporter for Rollbar, and their library requires the error object in order to do their own parsing.

@arb arb added the feature New functionality or improvement label Nov 5, 2014
@arb arb modified the milestones: 4.0.1, 4.1.0 Nov 5, 2014
@arb arb self-assigned this Nov 10, 2014
@arb
Copy link
Contributor

arb commented Nov 10, 2014

Because this could really impact downstream reporters I think you need to make this an option that defaults to false. Also, please add a test demonstrating that this works.

@@ -205,7 +205,8 @@ internals.Monitor.prototype._errorHandler = function (request, error) {
timestamp: request.info.received,
message: error.message,
stack: error.stack,
pid: process.pid
pid: process.pid,
originalError: error
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename to errorObject?

@bjyoungblood
Copy link
Author

I've updated the PR with your suggestions.

I'm thinking for a future major release, it might be better to remove this option and have good-reporter filter out the errorObject by default. This works well enough for now though.

@bjyoungblood
Copy link
Author

Rebased from master and fixed the test that was failing.

expect(eventsOne.length).to.equal(1);

expect(request.event).to.equal('error');
expect(request.errorObject).to.exist;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check the documentation for Code.expect here. Some of your assertions are no longer correct.

@bjyoungblood
Copy link
Author

Sorry about the delay in resolving these. I've been out of town.


server.start(function () {

var req = Http.request({
Copy link
Contributor

Choose a reason for hiding this comment

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

Just use a simple GET request here. A lot less code and a lot easier. All you really need to happen is the server to error. You can probably just do server.inject instead of starting up the whole HTTP stack.

@arb
Copy link
Contributor

arb commented Nov 24, 2014

Closing due to inactivity.

@arb arb closed this Nov 24, 2014
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants