Skip to content

Commit 1b9ae1a

Browse files
committed
fixing throws
1 parent fa6a3a2 commit 1b9ae1a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/java/de/idrinth/waraddonclient/service/Request.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
import java.io.File;
66
import java.io.IOException;
77
import de.idrinth.waraddonclient.model.TrustManager;
8+
import java.security.KeyManagementException;
9+
import java.security.KeyStoreException;
10+
import java.security.NoSuchAlgorithmException;
11+
import org.apache.http.HttpResponse;
12+
import org.apache.http.client.methods.HttpGet;
813

914
public class Request {
1015

@@ -18,7 +23,7 @@ public class Request {
1823

1924
private final FileLogger logger;
2025

21-
public Request(TrustManager manager, FileLogger logger) {
26+
public Request(TrustManager manager, FileLogger logger) throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
2227
this.logger = logger;
2328
sslContext = org.apache.http.ssl.SSLContextBuilder.create().loadTrustMaterial(
2429
manager.getKeyStore(),
@@ -73,10 +78,10 @@ public boolean upload(String url, File file) {
7378
}
7479

7580
public String getVersion() {
76-
org.apache.http.client.methods.HttpGet request = new org.apache.http.client.methods.HttpGet("https://api.github.com/repos/Idrinth/WARAddonClient/releases/latest");
77-
org.apache.http.HttpResponse response = executionHandler(request);
7881
String version = "";
7982
try {
83+
HttpGet request = new HttpGet("https://api.github.com/repos/Idrinth/WARAddonClient/releases/latest");
84+
HttpResponse response = executionHandler(request);
8085
if (response != null) {
8186
javax.json.JsonObject data = javax.json.Json.createReader(response.getEntity().getContent()).readObject();
8287
version = data.getString("tag_name");

0 commit comments

Comments
 (0)