Changeset 15:5806c1adb4d6

Show
Ignore:
Timestamp:
04/01/08 15:22:13 (8 months ago)
Author:
ryan@…
Branch:
default
Message:

Better error handling.

Location:
jmemcached-core/src/main/java/com/thimbleware/jmemcached
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • jmemcached-core/src/main/java/com/thimbleware/jmemcached/CommandDecoder.java

    r14 r15  
    225225 
    226226            out.write(cmd); 
     227        } else { 
     228            return new SessionStatus(ERROR); 
    227229        } 
    228230 
  • jmemcached-core/src/main/java/com/thimbleware/jmemcached/ServerSessionHandler.java

    r14 r15  
    232232     * @param cause   the exception 
    233233     */ 
    234     public void exceptionCaught(IoSession session, Throwable cause) { 
     234    public void exceptionCaught(IoSession session, Throwable cause) throws CharacterCodingException { 
    235235        // close the connection on exceptional situation 
    236236        logger.error(session.getAttribute("sess_id") + " EXCEPTION", cause); 
    237         cause.printStackTrace(); 
    238         session.close(); 
     237 
     238        ResponseMessage r = new ResponseMessage(); 
     239 
     240        // this needs to make a better distinction between server and client error messages 
     241        r.out.putString("CLIENT_ERROR\r\n", ENCODER); 
     242        session.write(r); 
    239243    } 
    240244