How to show full stack trace on eclipse?

前端 未结 7 1260
忘掉有多难
忘掉有多难 2020-12-01 20:20

I\'m using Eclipse to debug a Java application. Somewhere in the code I get an exception and the stack trace:

Caused by: java.io.EOFException: The connection         


        
7条回答
  •  不思量自难忘°
    2020-12-01 21:01

    You have the entire stack.

    This is only part of a stack trace. Directly before this was another piece. Look at the bottom lines of this one, and the top lines of the previous one. You'll see them match up. The stack trace began with a section that doesn't begin with "Caused by".

    The "Caused by" exception is hiding parts of the stack trace that are verbatim copies of stack trace entries in its parent. In other words, Java doesn't show the entire stack up to main() for every cause - it just shows what you haven't seen already. See the Throwable.printStackTrace() documentation.

    The "Caused by" is filled when you provide a cause when creating a Throwable. Look at the constructors for it. This is done when a piece of code catches a low-level exception and then wants to rethrow it as a different exception class.

提交回复
热议问题