Author: scottbw
Date: Fri Feb 19 23:28:54 2010
New Revision: 912032

URL: http://svn.apache.org/viewvc?rev=912032&view=rev
Log:
Provide more useful context information for authentication exceptions

Modified:
    incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java

Modified: incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java?rev=912032&r1=912031&r2=912032&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java 
(original)
+++ incubator/wookie/trunk/src/org/apache/wookie/proxy/ProxyClient.java Fri Feb 
19 23:28:54 2010
@@ -160,9 +160,9 @@
                                return readFully(new 
InputStreamReader(method.getResponseBodyAsStream(), "UTF-8"));
                        }
                        else if (statusCode == 
HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED || statusCode == 
HttpStatus.SC_UNAUTHORIZED)
-                               throw new AuthenticationException();            
                                                                                
                                                        
+                               throw new 
AuthenticationException("Authentication failed:"+ method.getStatusLine() + ' ' 
+ method.getURI() + ' ' + method.getStatusText());                              
                                                                                
                                       
                        else {
-                               throw new Exception("Method failed: " + 
method.getStatusLine() + ' ' + method.getURI() + ' ' + method.getStatusText() + 
method.getResponseBodyAsString()); //$NON-NLS-1$
+                               throw new Exception("Method failed: " + 
method.getStatusLine() + ' ' + method.getURI() + ' ' + method.getStatusText()); 
//$NON-NLS-1$
                        }
                } 
                catch (IOException e) {


Reply via email to