Changeset 15:5806c1adb4d6
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r14
|
r15
|
|
| 225 | 225 | |
| 226 | 226 | out.write(cmd); |
| | 227 | } else { |
| | 228 | return new SessionStatus(ERROR); |
| 227 | 229 | } |
| 228 | 230 | |
-
|
r14
|
r15
|
|
| 232 | 232 | * @param cause the exception |
| 233 | 233 | */ |
| 234 | | public void exceptionCaught(IoSession session, Throwable cause) { |
| | 234 | public void exceptionCaught(IoSession session, Throwable cause) throws CharacterCodingException { |
| 235 | 235 | // close the connection on exceptional situation |
| 236 | 236 | 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); |
| 239 | 243 | } |
| 240 | 244 | |