In ym ProtocolParser in
public boolean hasNextMessage() { ... }
I'm decoding the query received.
try {
ByteBuffer tmp = processingBuffer.duplicate();
msg = f_asciiDecoder.decode(tmp).toString();
} catch (CharacterCodingException e) {
s_logger.error("Error decoding query",e);
return false;
}
if I catch a exception, I would like to return a message to the client :
"Error processing the query..." (I could be any kind of exceptions)
how can I do that ?
I could return a message in
public String getNextMessage() {
if(s_logger.isDebugEnabled()){
s_logger.debug("getNextMessage");
}
if(exception){
return "Error processing the query...";
}
return query;
}
but if I do that (and I don't like it), I will have to test each query
return.