java - Why is exception.getCause() == exception? -
I made a mistake by thinking that the member variable's will cause
to be getCause ()
in org.apache.catalina.connector.ClientAbortException
will be returned as a result of the call. This is clearly not the case. The real reason is back.
Looking at the Source of Throwable, I can see that it indicates cause = this
that the reason has not been set yet. It was a bad question but I learned something from asking it.
Below is the original question:
Sometimes when you catch exceptions, getCause () will return the exception object itself, why not get this recursive (Reason) empty return?
getCause ()
should never return to itself If it is not override - if you are looking at code for getCause ()
then it clearly gives null
, if causes
The variable is the same as the throwable you are calling it on.
Which exceptions are you running again the same exception?
Comments
Post a Comment