[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit HttpServerNotFoundException.java,NONE,1.1
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-09-05 19:29:58
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory usw-pr-cvs1:/tmp/cvs-serv8075/src/com/meterware/httpunit Modified Files: HttpNotFoundException.java HttpWebResponse.java WebClient.java Added Files: HttpServerNotFoundException.java Log Message: Improved handling of not found exceptions ***** Error reading new file[Errno 2] No such file or directory: 'HttpServerNotFoundException.java' Index: HttpNotFoundException.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpNotFoundException.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- HttpNotFoundException.java 8 Nov 2001 22:07:52 -0000 1.4 +++ HttpNotFoundException.java 5 Sep 2002 19:29:55 -0000 1.5 @@ -30,13 +30,13 @@ **/ public class HttpNotFoundException extends HttpException { - - public HttpNotFoundException( URL url ) { - super( HttpURLConnection.HTTP_NOT_FOUND, "Not found", url ); + public HttpNotFoundException( String responseMessage, URL baseURL ) { + super( HttpURLConnection.HTTP_NOT_FOUND, responseMessage, baseURL ); } + public HttpNotFoundException( URL url, Throwable t ) { - super( HttpURLConnection.HTTP_NOT_FOUND, t.toString(), url ); + this( t.toString(), url ); } Index: HttpWebResponse.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpWebResponse.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- HttpWebResponse.java 21 Aug 2002 03:44:26 -0000 1.25 +++ HttpWebResponse.java 5 Sep 2002 19:29:55 -0000 1.26 @@ -133,7 +133,7 @@ private void readResponseHeader( URLConnection connection ) { - if (connection.getHeaderField(0) == null) throw new HttpNotFoundException( connection.getURL() ); + if (connection.getHeaderField(0) == null) throw new HttpServerNotFoundException( connection.getURL() ); StringTokenizer st = new StringTokenizer( connection.getHeaderField(0) ); st.nextToken(); Index: WebClient.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebClient.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- WebClient.java 5 Sep 2002 14:46:55 -0000 1.30 +++ WebClient.java 5 Sep 2002 19:29:55 -0000 1.31 @@ -434,7 +434,7 @@ if (response.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) { throw new HttpInternalErrorException( response.getURL() ); } else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) { - throw new HttpNotFoundException( response.getURL() ); + throw new HttpNotFoundException( response.getResponseMessage(), response.getURL() ); } else if (response.getResponseCode() >= HttpURLConnection.HTTP_BAD_REQUEST) { throw new HttpException( response.getResponseCode(), response.getResponseMessage(), response.getURL() ); } |