}
@Test
public void throwsExceptionOnError() {
String url = "http://direct.infohound.net/tools/404";
Connection con = Jsoup.connect(url);
boolean threw = false;
try {
Document doc = con.get();
} catch (HttpStatusException e) {
threw = true;
assertEquals("org.jsoup.HttpStatusException: HTTP error fetching URL. Status=404, URL=http://direct.infohound.net/tools/404", e.toString());
assertEquals(url, e.getUrl());
assertEquals(404, e.getStatusCode());