fernandezpablo85/scribe-java — Issue #231: request.send() returns a 404 response when it gets an UnknownHostException
Author: Pretz
Created: 2012-02-28 23:44:44+00:00
State: open

Based on the following code this appears to be intentional:

```java
Response(HttpURLConnection connection) throws IOException
{
try
{
connection.connect();
code = connection.getResponseCode();
headers = parseHeaders(connection);
stream = isSuccessful() ? connection.getInputStream() : connection.getErrorStream();
}
catch (UnknownHostException e)
{
code = 404;
body = Response.EMPTY;
}
}
```

I just burned an hour trying to figure out why my emulator was returning a 404 when it appeared to not be connecting to the server at all. Now I see it was a networking configuration problem and a bizarre design choice working in tandem.

Being unable to resolve a hostname and getting a 404 response are completely different. The method calling send() should be informed in a different way that an UnknownHostException occurred.