Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc7232dd

Browse files
committed
On CertPathValidationException, include cert path in exception message.
1 parentce883f4 commitc7232dd

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

‎src/main/java/com/dropbox/core/NetworkIOException.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
packagecom.dropbox.core;
22

3+
importjavax.net.ssl.SSLHandshakeException;
34
importjava.io.IOException;
5+
importjava.security.cert.CertPathValidatorException;
46

57
/**
68
* This gets thrown when there's an {@link IOException} when reading or writing to the
@@ -14,7 +16,24 @@ public class NetworkIOException extends DbxException {
1416
privatestaticfinallongserialVersionUID =0L;
1517

1618
publicNetworkIOException(IOExceptioncause) {
17-
super(cause.getMessage(),cause);
19+
super(computeMessage(cause),cause);
20+
}
21+
22+
privatestaticStringcomputeMessage(IOExceptionex) {
23+
Stringmessage =ex.getMessage();
24+
25+
// For CertPathValidationErrors, the CertPath is in the exception object but not
26+
// in the exception message. Pull it out into the message, because it would be
27+
// useful for debugging.
28+
if (exinstanceofSSLHandshakeException) {
29+
ThrowableinnerCause =ex.getCause();
30+
if (innerCauseinstanceofCertPathValidatorException) {
31+
CertPathValidatorExceptioncpve = (CertPathValidatorException)innerCause;
32+
message +="[CERT PATH: " +cpve.getCertPath() +"]";
33+
}
34+
}
35+
36+
returnmessage;
1837
}
1938

2039
@Override

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp