调整Exception类中的消息描述
This commit is contained in:
@@ -344,7 +344,7 @@ public class Pay3Api {
|
||||
writer.newLine();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new WeixinException(e.getMessage());
|
||||
throw new WeixinException(e);
|
||||
} finally {
|
||||
try {
|
||||
if (reader != null) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.foxinmy.weixin4j.exception;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.foxinmy.weixin4j.util.StringUtil;
|
||||
|
||||
/**
|
||||
@@ -34,8 +32,8 @@ public class WeixinException extends Exception {
|
||||
super(e);
|
||||
}
|
||||
|
||||
public WeixinException(String msg, IOException ex) {
|
||||
super(msg, ex);
|
||||
public WeixinException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public String getErrorCode() {
|
||||
|
||||
+2
@@ -20,6 +20,7 @@ import com.foxinmy.weixin4j.http.entity.FormUrlEntity;
|
||||
import com.foxinmy.weixin4j.http.entity.HttpEntity;
|
||||
import com.foxinmy.weixin4j.http.entity.StringEntity;
|
||||
import com.foxinmy.weixin4j.http.factory.HttpClientFactory;
|
||||
import com.foxinmy.weixin4j.http.factory.SimpleHttpClientFactory;
|
||||
import com.foxinmy.weixin4j.model.Consts;
|
||||
import com.foxinmy.weixin4j.util.StringUtil;
|
||||
import com.foxinmy.weixin4j.util.WeixinErrorUtil;
|
||||
@@ -44,6 +45,7 @@ public class WeixinRequestExecutor {
|
||||
}
|
||||
|
||||
public WeixinRequestExecutor(HttpParams params) {
|
||||
HttpClientFactory.setDefaultFactory(new SimpleHttpClientFactory());
|
||||
this.httpClient = HttpClientFactory.getInstance();
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
package com.foxinmy.weixin4j.http.weixin;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStore;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import javax.net.ssl.KeyManagerFactory;
|
||||
import javax.net.ssl.SSLContext;
|
||||
@@ -34,7 +36,7 @@ public class WeixinSSLRequestExecutor extends WeixinRequestExecutor {
|
||||
sslContext.init(kmf.getKeyManagers(), null,
|
||||
new java.security.SecureRandom());
|
||||
} catch (Exception e) {
|
||||
throw new WeixinException(e.getMessage());
|
||||
throw new WeixinException("Key load error", e);
|
||||
}
|
||||
params.setSSLContext(sslContext);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class FileTokenStorager implements TokenStorager {
|
||||
}
|
||||
return null;
|
||||
} catch (IOException e) {
|
||||
throw new WeixinException(e.getMessage());
|
||||
throw new WeixinException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class FileTokenStorager implements TokenStorager {
|
||||
new FileOutputStream(new File(String.format("%s/%s.xml",
|
||||
cachePath, cacheKey))));
|
||||
} catch (IOException e) {
|
||||
throw new WeixinException(e.getMessage());
|
||||
throw new WeixinException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user