Hacker News new | ask | show | jobs
by TheDong 1057 days ago
> HTTP 500 errors when viewing an account

> Stacktrace for that 500

This is the default ruby on rails behavior. It prints a stacktrace on any 500 or unknown error, and it's just line numbers and filepaths.

> megabytes on every single hit

I run a rails app that's very poorly designed.

I just checked, and the stack trace for a single 500 is 5KiB. It doesn't even add up to 1MiB a day since there's only a 500 error about every hour.

> This is either deep voodoo magic, or the code or configuration is turning a Xeon into the equivalent of a 286

Having a call stack handy is is actually pretty performant. Java's default exception behavior is to bubble up a stack trace with every exception, whether you print it or not, and java applications run just fine. You have the call stack anyway since you have to know how to return, so the only extra information you need handy is the filename and line number debug symbols, and ruby needs that info anyway just by the nature of the language.

1 comments

>Java's default exception behavior is to bubble up a stack trace with every exception, whether you print it or not,

Anyone who has spent 5 minutes in Java knows exactly what this looks like. And also how unwelcoming it is to new programmers.

I have spent more than 5 minutes in java, and I don't know why having a stack available on an exception is unwelcoming to new programmers.

It definitely seems better than the approaches some other languages have, like C's "return code 1, check errno", when most new programmers don't even know what an errno is.

Can you explain it to me?

Sure, but imagine how unwelcoming to everyone it would be if you didn't get a stack trace.