Good. :-) Learn something new today. Thanks! Xuelei
On 7/6/2013 9:18 AM, Brad Wetmore wrote: > > > On 7/2/2013 8:29 PM, Xuelei Fan wrote: >> On 7/3/2013 8:30 AM, Brad Wetmore wrote: >>> http://cr.openjdk.java.net/~wetmore/8019341/webrev.01/ >> >> 261 // If both failed, return the curthread's exception. >> 262 local.initCause(remote); >> >> The mix the initial cause of the exception would make it hard to parse >> the real cause of a exception. I would like to dump both exception in >> the log so that we would know both exceptions in client and server. > > An exception can have both an init cause and one or more suppressed > exceptions: > > Exception in thread "main" java.lang.Exception: Main block > at Foo3.main(Foo3.java:7) > Suppressed: Resource$CloseFailException: Resource ID = 2 > at Resource.close(Resource.java:26) > at Foo3.main(Foo3.java:5) > Suppressed: Resource$CloseFailException: Resource ID = 1 > at Resource.close(Resource.java:26) > at Foo3.main(Foo3.java:5) > Caused by: java.lang.Exception: I did it > at Foo3.main(Foo3.java:8) > > This is a very contrived example, but you'll see something that looks > like this: > > [brwetmor@flicker-vm1] 319 >java SSLSocketTemplate > Server died... > Exception in thread "main" java.lang.Exception: My client died... > at SSLSocketTemplate.doClientSide(SSLSocketTemplate.java:127) > at SSLSocketTemplate.startClient(SSLSocketTemplate.java:310) > at SSLSocketTemplate.<init>(SSLSocketTemplate.java:191) > at SSLSocketTemplate.main(SSLSocketTemplate.java:175) > Suppressed: java.lang.Exception: Some kind of other problem > at SSLSocketTemplate.<init>(SSLSocketTemplate.java:199) > ... 1 more > Caused by: java.lang.Exception: Server problem > at SSLSocketTemplate$1.run(SSLSocketTemplate.java:266) > > Thanks, > > Brad >