Finding out why an app crashed
See original GitHub issueI am adding Forever functionality to my web server, PagePark.
Basically where ever you can put web content, you can put a Node app.
We assign a port and route requests to the domain name you’ve declared. It works nicely, and I’m already using it in deployed apps.
My question – how do you get a handle on the error when one of the apps crashes, ie when Forever relaunches it after an error.
I’ll provide the code below that I use that I think should catch the error, but it clearly doesn’t in at least some circumstances.
I got the error to show up by running the app standalone, and then the OS gave me the error and stack crawl, and I was on my way. I want the same info when Forever is managing the app.
Thanks in advance for any help.
var child = new (foreverMonitor.Monitor) (f, options);
forever.startServer (child);
child.on ("stdout", function (linetext) {
addToLogFile (f, linetext);
});
child.on ("stderr", function (data) {
addToLogFile (f, "pagePark on stderr: " + data.toString ());
});
child.on ("error", function (err) {
addToLogFile (f, "pagePark on error: " + utils.trimWhitespace (err.toString ()));
});
child.on ("exit", function () {
addToLogFile (f, "pagePark on exit: f == " + f + "\n");
});
child.start ();
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Detect and diagnose crashes - Android Developers
There are many situations that can cause a crash in your app. Some reasons are obvious, like checking for a null value or...
Read more >How to Diagnose App Issues Using Crash Logs - Papertrail
When apps crash, they generate logs containing information related to where the issues causing the crash occurred. Looking at these logs is a...
Read more >View crashes and application not responding (ANR) errors
Find your data · Open Play Console. · Select an app. · On the left menu, select Quality > Android vitals > Crashes...
Read more >How to Fix Crashing Apps on an iPhone or Android?
Sometimes app-crashing is not caused by your phone, but rather the app itself. An internal error, or bug, may have brought the app...
Read more >How to get Android App Crash Logs? | BrowserStack
Open the Report Text File on the desktop and find System Log in the report. · The error can be located with a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I still would like to figure this out. Thanks for respecting that and let’s move on please.
Have you considered using an Exception handling service like Sentry? You can self-host the backend fairly painlessly so it’s not like you’re introducing a black hole of cost.
See: https://docs.sentry.io/platforms/javascript/