Skip to content

Commit

Permalink
catch more exceptions safely
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Whalin committed Aug 31, 2010
1 parent 6a7fb63 commit b22f90d
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/com/meetup/memcached/MemcachedClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1377,26 +1377,12 @@ public Object get( String key, Integer hashCode, boolean asString ) {
if ( log.isInfoEnabled() )
log.info( "++++ deserializing " + o.getClass() );
}
catch ( InvalidClassException e ) {
/* Errors de-serializing are to be expected in the case of a
* long running server that spans client restarts with updated
* classes.
*/
// if we have an errorHandler, use its hook
if ( errorHandler != null )
errorHandler.handleErrorOnGet( this, e, key );

o = null;
log.error( "++++ InvalidClassException thrown while trying to deserialize for key: " + key + " -- " + e.getMessage() );
}
catch ( ClassNotFoundException e ) {

// if we have an errorHandler, use its hook
catch ( Exception e ) {
if ( errorHandler != null )
errorHandler.handleErrorOnGet( this, e, key );

o = null;
log.error( "++++ ClassNotFoundException thrown while trying to deserialize for key: " + key + " -- " + e.getMessage() );
log.error( "++++ Exception thrown while trying to deserialize for key: " + key + " -- " + e.getMessage() );
}
}
}
Expand Down

0 comments on commit b22f90d

Please sign in to comment.