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.

Finding out why an app crashed

See original GitHub issue

I 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:open
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
scriptingcommented, Jun 22, 2020

I still would like to figure this out. Thanks for respecting that and let’s move on please.

1reaction
imsickofmapscommented, Jun 23, 2020

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/

Read more comments on GitHub >

github_iconTop 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 >

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