From 201680bab04b3e70071a94134c1978076fe59a88 Mon Sep 17 00:00:00 2001 From: Peet Goddard Date: Thu, 16 Jan 2014 18:06:26 +0000 Subject: [PATCH] make resty not throw an exception for non-200 responses --- src/main/java/us/monoid/web/AbstractResource.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/us/monoid/web/AbstractResource.java b/src/main/java/us/monoid/web/AbstractResource.java index d710fe8..e311fdc 100644 --- a/src/main/java/us/monoid/web/AbstractResource.java +++ b/src/main/java/us/monoid/web/AbstractResource.java @@ -50,14 +50,14 @@ void fill(URLConnection anUrlConnection) throws IOException { baos.write(buf, 0, read); } } catch (IOException e1) { - log.warning("IOException when reading the error stream. Igored"); + log.warning("IOException when reading the error stream. Ignored"); } // close the errorstream es.close(); - throw new IOException("Error while reading from " + conn.getRequestMethod() + ": [" + conn.getResponseCode() + "] " - + conn.getResponseMessage() + "\n" + new String(baos.toByteArray(), "UTF-8"), e); + inputStream = new ByteArrayInputStream(baos.toByteArray()); + } else { throw e; }