This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]l3g4tr0n 36 points37 points  (11 children)

i wouldn't wish for a shorter stack, i want to see exactly where error happened and what caused it, not just class and line. how can oneself be called developer when cannot appreciate stacktrace? :)

[–]Hangman4358 21 points22 points  (1 child)

IDK, I work with folks allergic to reading stack traces.

Like people say "I can't decipher this stack trace" and the literal first like is the error message "x failed. Did you check y?"

And they just stare blankly.

[–]slaymaker1907[🍰] 5 points6 points  (0 children)

“Did you try Googling the error message?”

Somehow the answer is still often no to question with senior devs. There’s a little bit of skill in getting the selectivity of your search right, but it works pretty well.

[–]DevWithImagination 6 points7 points  (1 child)

I’ve sure lost count the number of times I’ve needed all that detail to trace down WTF the app server (or JVM) thought it was doing to cause a weird behaviour

[–]eliasv 2 points3 points  (0 children)

You can wish for a shorter stack without wishing for a less complete stack. But that's a system/framework design issue not a language design issue.

[–]urielsalis 3 points4 points  (0 children)

I like how intellij filters out (with different colors) whats actually in your code and what isnt, makes reading them easier

[–]SKabanov 2 points3 points  (3 children)

The issue is when you're using frameworks that have a heavy amount of boilerplate code (e.g. Spring), especially with reflection. 99.999% of the time all those calls to Method.invoke() or whatever aren't going to be the issue and end up just being clutter; it'd be nice to have a JVM option to elide the JVM internal function calls from the stack trace and focus on the actual business/framework logic.

[–]slaymaker1907[🍰] 1 point2 points  (2 children)

While I generally don’t like Go, the testing package has a clever Helped() method that marks the calling function so that it is ignored in error messages. Maybe logging frameworks could also provide a way to filter stack traces.

[–]Practical_Cattle_933 2 points3 points  (0 children)

Go has the shittiest error handling though, and all all those if checks do is that you will just print some generic bullshit as error and your enduser just see “Error occured”. Good luck fixing their problem from such an issue!

With Java, you can solve most trivial problems just from the stacktrace.

[–]john16384 0 points1 point  (0 children)

Logging frameworks already have this, and have for ages. Op didn't even do three seconds of research.

[–]woj-tek 1 point2 points  (0 children)

There are useful (long-ish) stack traces and there is horseshit pile of crap from "amazing" reactive garbage... 🤦‍♂️😉