Skip to content

[Request] How to read stack traces #53

Description

@danthe1st

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?

Activity

  1. carimura commented on Nov 1, 2023

    @carimura
    Contributor

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

  2. danthe1st commented on Nov 1, 2023

    @danthe1st
    ContributorAuthor

    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.

  3. carimura commented on Jan 23, 2024

    @carimura
    Contributor

    hi @danthe1st was this ever worked on?

  4. danthe1st commented on Jan 23, 2024

    @danthe1st
    ContributorAuthor

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

  5. carimura commented on Apr 26, 2024

    @carimura
    Contributor

    Would you like to work on it? :)

  6. danthe1st commented on Apr 26, 2024

    @danthe1st
    ContributorAuthor

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

  7. carimura commented on Apr 26, 2024

    @carimura
    Contributor

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

  8. danthe1st commented on May 5, 2024

    @danthe1st
    ContributorAuthor

    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.

  9. moved this from In progress to In review in @Drovie's untitled projecton Feb 10, 2026
  10. moved this from In review to In progress in @Drovie's untitled projecton Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions