Mention status code in failed state
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 26 Aug 2015 10:15:03 +0000 (12:15 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 26 Aug 2015 10:15:03 +0000 (12:15 +0200)
src/main/java/net/pterodactylus/rhynodge/queries/HttpQuery.java

index 3d28590..8e2c242 100644 (file)
@@ -81,7 +81,7 @@ public class HttpQuery implements Query {
                        HttpConnectionParams.setSoTimeout(get.getParams(), (int) TimeUnit.SECONDS.toMillis(300));
                        HttpResponse response = httpClient.execute(get);
                        if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
-                               return new FailedState();
+                               return new FailedState(new IllegalStateException(String.format("Invalid HTTP Status: %d", response.getStatusLine().getStatusCode())));
                        }
                        HttpEntity entity = response.getEntity();