Skip to content
Browse files

converted e.printStackTrace() to log.error(ExceptionUtils.getStackTra…

…ce(e))
  • Loading branch information...
1 parent a946e76 commit 733279873e2443d5e5ad6bd9260d8a6e07569eb6 william.kinney committed Aug 26, 2008
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/java/com/fourspaces/couchdb/Session.java
View
15 src/java/com/fourspaces/couchdb/Session.java
@@ -27,14 +27,15 @@
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.methods.StringRequestEntity;
-import org.apache.commons.httpclient.auth.AuthScope;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -286,8 +287,7 @@ CouchResponse post(String url, String content, String queryString) {
}
post.setRequestEntity(entity);
} catch (UnsupportedEncodingException e) {
- log.error(e);
- e.printStackTrace();
+ log.error(ExceptionUtils.getStackTrace(e));
}
}
if (queryString!=null) {
@@ -318,8 +318,7 @@ CouchResponse put(String url, String content) {
entity = new StringRequestEntity(content, "application/json","UTF-8");
put.setRequestEntity(entity);
} catch (UnsupportedEncodingException e) {
- log.error(e);
- e.printStackTrace();
+ log.error(ExceptionUtils.getStackTrace(e));
}
}
return http(put);
@@ -374,9 +373,9 @@ protected CouchResponse http(HttpMethod method) {
httpClient.executeMethod(method);
lastResponse = new CouchResponse(method);
} catch (HttpException e) {
- e.printStackTrace();
+ log.error(ExceptionUtils.getStackTrace(e));
} catch (IOException e) {
- e.printStackTrace();
+ log.error(ExceptionUtils.getStackTrace(e));
} finally {
method.releaseConnection();
}

0 comments on commit 7332798

Please sign in to comment.
Something went wrong with that request. Please try again.