exceptionless / Exceptionless.JavaScript

Exceptionless JavaScript client
http://exceptionless.com
Apache License 2.0
59 stars 24 forks source link

Fix: Log unhandled exceptions in Node.js #30

Closed frankebersoll closed 8 years ago

frankebersoll commented 8 years ago

This is the first pull request for issue #29.

It adds an IExitController which is responsible for behavior when the application is exiting. If isApplicationExiting is true, NodeSubmissionClient will use synchronous event submission. A child process will be spawned synchronously, and pipes are used to transmit the request and response data.

Try it out using the following test:

var client = require("./dist/exceptionless.node.js").ExceptionlessClient.default;
var spawnSync = require("child_process").spawnSync;
var events = require("events");

client.config.apiKey = "WHATEVER";
client.config.useDebugLogger();

throw new Error("Test: Error");
ejsmith commented 8 years ago

Thanks for the contribution!

niemyjski commented 8 years ago

Thank you very much for the pull request! Awesome job man! I know it was a lot of hard work. I don't follow one part of of the child process workflow and was wondering if we could meet up and you could give me a quick tour. I'd just like to follow 100% how it works so I can help support it and help maintain it :).

I was also wondering about your exit controller and wanted your feedback ( @frankebersoll @ejsmith). I was wondering if there is ever a time we would want more behaviors:

I'm not sure if we'd need these or not. If you can think of any other behaviors we might need to support we might want to refactor the exit controller into a behavior that covers on exit. Do you think we would ever need this, and if so do you think we should future proof it??

frankebersoll commented 8 years ago

Okay, now I know what "rename branch" in Tower actually does... 😔

frankebersoll commented 8 years ago

Okay, now we have:

niemyjski commented 8 years ago

Ship it