Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] How to read stack traces #53

Open
danthe1st opened this issue Oct 31, 2023 · 8 comments
Open

[Request] How to read stack traces #53

danthe1st opened this issue Oct 31, 2023 · 8 comments

Comments

@danthe1st
Copy link
Contributor

danthe1st commented Oct 31, 2023

There are currently 4 articles about exceptions on dev.java.

However, none of them seem to explain what exactly a stack trace is, how to read it and how to find out where the issue is.

I frequently see new Java users (e.g. students) being confused by (especially bigger) stack traces with no idea on how to debug them.

While this Stack Overflow post explains it quite well, I think this is a good fit and would be a helpful article (especially for referencing it to new Java developers).

I would like such an article to contain the following:

  • What is a stack trace?
  • When is a stack trace displayed on the console (or in other logs)?
  • What is a Caused By section?
  • What is a Suppressed section?
  • What should people look at/focus on when reading (bigger) stack traces?
    • Differentiating between own code and other code (in frameworks)
  • Why is it often a bad idea to use System.out.println("error"); instead of e.printStackTrace(); (or re-throwing) in a catch-block for exceptions that shouldn't happen?
@carimura
Copy link
Member

carimura commented Nov 1, 2023

Great! Also if you find places in existing content where we can reference this new article, let us know!

@danthe1st
Copy link
Contributor Author

danthe1st commented Nov 1, 2023

It might be possible to mention this article in the Stack Overflow post mentioned above.
However, it's probably a good idea to first ask on Meta Stack Overflow before whether this is OK for them since they consider any sort of undisclosed affiliation as spam but I'm fairly certain they should be fine with an official article. I can do that if necessary.

Furthermore, we are probably able to use a link to that article in our JUG when people ask about stack traces.

@carimura
Copy link
Member

hi @danthe1st was this ever worked on?

@danthe1st
Copy link
Contributor Author

@carimura I don't know of anything being done with respect to this issue.

@carimura
Copy link
Member

Would you like to work on it? :)

@danthe1st
Copy link
Contributor Author

I actually wanted to ask for that recently. So yeah, I would be interested to work on that if I find time.

@carimura
Copy link
Member

sounds good. trying to organize content "in flight" with a new label. no rush. :)

@danthe1st
Copy link
Contributor Author

danthe1st commented May 5, 2024

Should this be closed now that #87 is held off or should this issue be kept open (with the progress label removed)?
I don't know about the exact plans for content on stack traces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants