better error messages when scribe can't establish a network connection

This commit is contained in:
Pablo Fernandez committed 2011-09-25 16:37:49 -03:00
1 parent 9f4569fbbc
commit 24babbae02
2 files changed
+10 -4

No files matched your search

+7 -2
View File
@@ -59,9 +59,14 @@ class Request
{
createConnection();
return doSend();
} catch (IOException ioe)
}
catch (UnknownHostException uhe)
{
throw new OAuthException("Problems while creating connection", ioe);
throw new OAuthException("Could not reach the desired host. Check your network connection.", uhe);
}
catch (IOException ioe)
{
throw new OAuthException("Problems while creating connection.", ioe);
}
}
+3 -2
View File
@@ -28,10 +28,11 @@ public class Response
code = connection.getResponseCode();
headers = parseHeaders(connection);
stream = wasSuccessful() ? connection.getInputStream() : connection.getErrorStream();
} catch (UnknownHostException e)
}
catch (UnknownHostException e)
{
code = 404;
body = EMPTY;
body = Response.EMPTY;
}
}