Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upError event includes original error #246
Conversation
This comment has been minimized.
This comment has been minimized.
Because this could really impact downstream reporters I think you need to make this an option that defaults to |
@@ -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 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 |
This comment has been minimized.
This comment has been minimized.
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; |
This comment has been minimized.
This comment has been minimized.
arb
Nov 10, 2014
Contributor
Please check the documentation for Code.expect
here. Some of your assertions are no longer correct.
@@ -27,7 +27,8 @@ internals.defaults = { | |||
requestsEvent: 'tail', // Sets the event used by the monitor to listen to finished requests. Other options: 'response'. | |||
logRequestHeaders: false, // log all headers on request | |||
logRequestPayload: false, // log payload of request | |||
logResponsePayload: false // log payload of response | |||
logResponsePayload: false, // log payload of response | |||
logErrorObject: false, // send original error object to reporters |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sorry about the delay in resolving these. I've been out of town. |
|
||
server.start(function () { | ||
|
||
var req = Http.request({ |
This comment has been minimized.
This comment has been minimized.
arb
Nov 19, 2014
Contributor
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.
@@ -208,6 +209,10 @@ internals.Monitor.prototype._errorHandler = function (request, error) { | |||
pid: process.pid | |||
}; | |||
|
|||
if (this.settings.logErrorObject) { | |||
event.errorObject = error; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Closing due to inactivity. |
bjyoungblood commentedNov 5, 2014
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.