Skip to content

Commit e109037

Browse files
committed
🎨 优化部分代码
1 parent 358850a commit e109037

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData) throws WxPa
144144
} catch (WxPayException e) {
145145
throw e;
146146
} catch (Exception e) {
147-
throw new WxPayException("发生异常," + e.getMessage(), e);
147+
throw new WxPayException("发生异常!", e);
148148
}
149149
}
150150

@@ -508,7 +508,7 @@ private WxPayBillResult handleBill(String billType, String responseContent) {
508508
return WxPayBillResult.fromRawBillResultString(responseContent, billType);
509509
}
510510

511-
private String handleGzipBill(String url, String requestStr) {
511+
private String handleGzipBill(String url, String requestStr) throws WxPayException {
512512
try {
513513
byte[] responseBytes = this.postForBytes(url, requestStr, false);
514514
Path tempDirectory = Files.createTempDirectory("bill");
@@ -522,13 +522,12 @@ private String handleGzipBill(String url, String requestStr) {
522522
throw WxPayException.from(BaseWxPayResult.fromXML(new String(responseBytes, StandardCharsets.UTF_8),
523523
WxPayCommonResult.class));
524524
} else {
525-
throw new WxPayException("解压zip文件出错," + e.getMessage(), e);
525+
throw new WxPayException("解压zip文件出错!", e);
526526
}
527527
}
528528
} catch (Exception e) {
529-
throw new WxPayException("解析对账单文件时出错," + e.getMessage(), e);
529+
throw new WxPayException("解析对账单文件时出错!", e);
530530
}
531-
return null;
532531
}
533532

534533
@Override
@@ -582,7 +581,7 @@ private String handleGzipFundFlow(String url, String requestStr) throws WxPayExc
582581
} catch (WxPayException wxPayException) {
583582
throw wxPayException;
584583
} catch (Exception e) {
585-
throw new WxPayException("解压zip文件出错",e);
584+
throw new WxPayException("解压zip文件出错", e);
586585
}
587586
}
588587

0 commit comments

Comments
 (0)