1
0
mirror of synced 2025-12-21 08:30:11 +08:00

为WxError加入builder模式支持

This commit is contained in:
Binary Wang
2016-06-16 23:03:32 +08:00
parent dca8e307a0
commit 7057b8a960
2 changed files with 29 additions and 5 deletions

View File

@@ -483,9 +483,8 @@ public class WxMpServiceImpl implements WxMpService {
try {
return String.format(url, URLEncoder.encode(ticket, Charsets.UTF_8.name()));
} catch (UnsupportedEncodingException e) {
WxError error = new WxError();
error.setErrorCode(-1);
error.setErrorMsg(e.getMessage());
WxError error = WxError.newBuilder().setErrorCode(-1)
.setErrorMsg(e.getMessage()).build();
throw new WxErrorException(error);
}
}