Hacker News new | ask | show | jobs
by sackerhews 1594 days ago
Printing out an exception stacktrace is generally awful in a non development context.

But hiding them and printing out "failed to run" is even worse.

I've seen people do that to have a "neat output".

Don't be that person.

4 comments

I'm sad that we forgot the value of core dumping. Stacktraces are cool and all, especially when you're developing and just want to know which assertion didn't hold. In production we have to deal with issues that we can't reproduce, and a a huge step up from stacktraces in that context is dumping core.

I wish there was an easy way to dump core from java inside a docker container, and some sort of software for keeping track of them. Something like coredumpctl and journald, but for k8s.

> I'm sad that we forgot the value of core dumping.

The value of the core dumping has greatly diminished once commercial vendors have started stripping symbol tables from binaries they would ship (IP protection! trade secrets! know-how!), and it has diminished even greater when core dumps started approaching gigabytes in size – the reaction of system administrators was swift and cruel: «ulimit -c 0» at the system level.

Stack traces are in that awkward spot where they mean nothing to a user but are often nearly useless to a developer as well. You really need a good core dump reporting system with something like Breakpad, in addition to whatever you tell the user.
you've made me curious. what makes Breakpad so useful?

[edit: i looked - it looks like a way to get cores off a machine and get a stack trace. which is nice ,but hardly changes the picture very much]

I've had good experiences with "error codes".

In our case, we came up with a way to assign unique codes to standard library exceptions for the language we use(.NET), custom codes for our own exceptions, and mask that with a number that roughly indicates where the exception occurred.

You end up getting codes like 0x800482c6 though which might end up frustrating users, since they have no real way to decode them.

Putting on my "user" hat, a stack trace is a just a long winded way of saying "ABEND" or "core dumped".