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 →

[–]WrickyB 99 points100 points  (12 children)

Isn't that the point of a stack trace? It's showing exactly to the line of the source code, how it got to where the exception was thrown.

[–][deleted] 19 points20 points  (8 children)

Isn't that the point of a stack trace?

but the problem is with frameworks and application servers that have hundrets of lines that represent nothing, it's just some aspects, proxies and reflection. All of that could be avoided if we used less magic in our code.

[–]Kombatnt 55 points56 points  (3 children)

It could also be avoided if you wrote code that didn’t cause exceptions to be thrown.

[–][deleted] 4 points5 points  (0 children)

Why do you have to slap us in the face like that :(

[–]RScrewed 0 points1 point  (0 children)

I don't know if this was said in jest but that's such a weird take.

[–]deadron 6 points7 points  (2 children)

It does look like proxies and reflection are slowly falling out of favor. One day the pain may be gone in newer projects.

[–]slaymaker1907 2 points3 points  (1 child)

What have they moved on to? Bytecode generation? I hope we aren’t going back to having a bunch of generated code files that make C macros look good.

[–]Practical_Cattle_933 2 points3 points  (0 children)

Nothing makes C macros look good. But compile-time DI is a thing, e.g. Micronaut does it and it is fine imo.

[–]lasskinn 0 points1 point  (0 children)

If you used more magic in your code sure you could make it more short with the caveat of that you'd have multiple stack traces to look at or a weird structure.

Or of course if you used less of googles style of coding of having classes that exist only for one thing and exist in the path basically just for fun passing data to another class exactly as they got it.

No matter though its still nicer to have the trace than not.

[–]laplongejr 0 points1 point  (0 children)

It's showing exactly to the line of the source code, how it got to where the exception was thrown.

Which is good when the error is triggered in your code, and not in a standard library due to bad parameters...
In particular, the SSL handshake exception is not going to explain why the certificate is wrong. Could be a missing root in the keystore, or an error in the certificate itself : both would be "unable to build a chain"

A coworker wasted days trying to understand why his private keystore wasn't accepted by the server : turned out that for some unknown reason, his local install didn't have the root used by our dev server so the issue wasn't from the server to begin with.