Skip to content

Commit 971ca5b

Browse files
committed
Refactor on catch multiple exceptions for better readability
1 parent 1ec13ac commit 971ca5b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

webmagic-core/src/main/java/us/codecraft/webmagic/downloader/HttpClientGenerator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ private SSLConnectionSocketFactory buildSSLConnectionSocketFactory() {
6969
return new SSLConnectionSocketFactory(sslContext, supportedProtocols,
7070
null,
7171
new DefaultHostnameVerifier()); // 优先绕过安全证书
72-
} catch (KeyManagementException e) {
73-
logger.error("ssl connection fail", e);
74-
} catch (NoSuchAlgorithmException e) {
72+
} catch (KeyManagementException | NoSuchAlgorithmException e) {
7573
logger.error("ssl connection fail", e);
7674
}
7775
return SSLConnectionSocketFactory.getSocketFactory();

0 commit comments

Comments
 (0)