Permalink
Browse files

List the address in the connection exception

  • Loading branch information...
1 parent 577aa82 commit b44cc4d4ba71edbb41081a519df0586fcf5333f1 @timf committed Jan 29, 2014
Showing with 14 additions and 14 deletions.
  1. +14 −14 src/main/java/org/dasein/persist/riak/RiakCache.java
@@ -393,10 +393,10 @@ public long count(SearchTerm ... terms) throws PersistenceException {
code = client.executeMethod(post);
}
catch( HttpException e ) {
- throw new PersistenceException("HttpException during POST: " + e.getMessage());
+ throw new PersistenceException("HttpException during POST to Riak at " + getEndpoint() +": " + e.getMessage());
}
catch( IOException e ) {
- throw new PersistenceException("IOException during POST: " + e.getMessage());
+ throw new PersistenceException("IOException during POST to Riak at " + getEndpoint() +": " + e.getMessage());
}
try {
String body = post.getResponseBodyAsString();
@@ -694,11 +694,11 @@ else if( item.getClass().equals(long.class) || item.getClass().equals(int.class)
}
catch( HttpException e ) {
std.error("HTTP exception during POST: " + e.getMessage());
- throw new PersistenceException("HttpException during POST: " + e.getMessage());
+ throw new PersistenceException("HttpException during POST to Riak at " + getEndpoint() +": " + e.getMessage());
}
catch( IOException e ) {
std.error("I/O exception during POST: " + e.getMessage());
- throw new PersistenceException("I/O exception during POST: " + e.getMessage());
+ throw new PersistenceException("I/O exception during POST to Riak at " + getEndpoint() +": " + e.getMessage());
}
try {
String body = post.getResponseBodyAsString();
@@ -893,10 +893,10 @@ else if( terms[0].getValue() == null || (!(terms[0].getValue() instanceof Long)
code = client.executeMethod(post);
}
catch( HttpException e ) {
- throw new PersistenceException("HttpException during POST: " + e.getMessage());
+ throw new PersistenceException("HttpException during POST to Riak at " + getEndpoint() +": " + e.getMessage());
}
catch( IOException e ) {
- throw new PersistenceException("IOException during POST: " + e.getMessage());
+ throw new PersistenceException("IOException during POST to Riak at " + getEndpoint() +": " + e.getMessage());
}
try {
String body = post.getResponseBodyAsString();
@@ -1163,10 +1163,10 @@ private JSONObject findKeysInBucketAsJSON() throws PersistenceException {
code = client.executeMethod(get);
}
catch( HttpException e ) {
- throw new PersistenceException("HttpException during GET: " + e.getMessage());
+ throw new PersistenceException("HttpException during GET to Riak at " + getEndpoint() +": " + e.getMessage());
}
catch( IOException e ) {
- throw new PersistenceException("IOException during GET: " + e.getMessage());
+ throw new PersistenceException("IOException during GET to Riak at " + getEndpoint() +": " + e.getMessage());
}
try {
String json = get.getResponseBodyAsString();
@@ -1256,10 +1256,10 @@ public T load(Object ... args ) {
code = client.executeMethod(get);
}
catch( HttpException e ) {
- throw new RuntimeException("HttpException during GET: " + e.getMessage());
+ throw new RuntimeException("HttpException during GET to Riak at " + getEndpoint() +": " + e.getMessage());
}
catch( IOException e ) {
- throw new RuntimeException("IOException during GET: " + e.getMessage());
+ throw new RuntimeException("IOException during GET to Riak at " + getEndpoint() +": " + e.getMessage());
}
try {
final String body = get.getResponseBodyAsString();
@@ -1497,10 +1497,10 @@ else if( Locale.class.isAssignableFrom(entry.getValue()) || Currency.class.isAss
code = client.executeMethod(get);
}
catch( HttpException e ) {
- throw new PersistenceException("HttpException during GET: " + e.getMessage());
+ throw new PersistenceException("HttpException during GET to Riak at " + getEndpoint() +": " + e.getMessage());
}
catch( IOException e ) {
- throw new PersistenceException("IOException during GET: " + e.getMessage());
+ throw new PersistenceException("IOException during GET to Riak at " + getEndpoint() +": " + e.getMessage());
}
try {
final String body = get.getResponseBodyAsString();
@@ -1784,10 +1784,10 @@ public void remove(Transaction xaction, T item) throws PersistenceException {
code = client.executeMethod(delete);
}
catch( HttpException e ) {
- throw new PersistenceException("HttpException during GET: " + e.getMessage());
+ throw new PersistenceException("HttpException during GET to Riak at " + getEndpoint() +": " + e.getMessage());
}
catch( IOException e ) {
- throw new PersistenceException("IOException during GET: " + e.getMessage());
+ throw new PersistenceException("IOException during GET to Riak at " + getEndpoint() +": " + e.getMessage());
}
try {
String body = delete.getResponseBodyAsString();

0 comments on commit b44cc4d

Please sign in to comment.