aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/trygvis/esper/testing/util
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-12-08 13:39:28 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2012-12-08 13:39:28 +0100
commit953ddf830be3ec5188762c2471d007478e6573a1 (patch)
treea6a90410f43f67891901ed2be2a300f64a069c07 /src/main/java/io/trygvis/esper/testing/util
parent58e2f4c4ef4655c88270b2c3a6b53ef642f82c57 (diff)
downloadesper-testing-953ddf830be3ec5188762c2471d007478e6573a1.tar.gz
esper-testing-953ddf830be3ec5188762c2471d007478e6573a1.tar.bz2
esper-testing-953ddf830be3ec5188762c2471d007478e6573a1.tar.xz
esper-testing-953ddf830be3ec5188762c2471d007478e6573a1.zip
o Discovering and storing jobs in addition to the build.
Diffstat (limited to 'src/main/java/io/trygvis/esper/testing/util')
-rwxr-xr-xsrc/main/java/io/trygvis/esper/testing/util/HttpClient.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/io/trygvis/esper/testing/util/HttpClient.java b/src/main/java/io/trygvis/esper/testing/util/HttpClient.java
index 79159ac..5ac7d13 100755
--- a/src/main/java/io/trygvis/esper/testing/util/HttpClient.java
+++ b/src/main/java/io/trygvis/esper/testing/util/HttpClient.java
@@ -16,6 +16,7 @@ import org.slf4j.*;
import java.io.*;
import java.net.*;
+import static fj.data.Option.none;
import static java.lang.System.*;
public class HttpClient<A> {
@@ -44,7 +45,7 @@ public class HttpClient<A> {
};
}
- public Option<A> fetch(URI uri) throws IOException {
+ public Option<A> fetch(URI uri) {
HTTPResponse response = null;
try {
@@ -52,12 +53,14 @@ public class HttpClient<A> {
int code = response.getStatus().getCode();
if (code != 200) {
- throw new IOException("Did not get 200 back, got " + code);
+ logger.warn("Did not get 200 back, got " + code);
+ return none();
}
return f.f(response);
} catch (HTTPException e) {
- throw new IOException(e);
+ logger.warn("Error while fetching: " + uri, e);
+ return none();
} finally {
if (response != null) {
try {