voldemort.rest
Class RestErrorHandler

java.lang.Object
  extended by voldemort.rest.RestErrorHandler
Direct Known Subclasses:
RestDeleteErrorHandler, RestGetErrorHandler, RestGetVersionErrorHandler, RestPutErrorHandler

public class RestErrorHandler
extends java.lang.Object


Field Summary
protected  org.apache.log4j.Logger logger
           
 
Constructor Summary
RestErrorHandler()
           
 
Method Summary
protected  void handleExceptions(org.jboss.netty.channel.MessageEvent messageEvent, java.lang.Exception exception)
          Exceptions specific to each operation is handled in the corresponding subclass.
static void writeErrorResponse(org.jboss.netty.channel.MessageEvent messageEvent, org.jboss.netty.handler.codec.http.HttpResponseStatus status, java.lang.String message)
          Writes all error responses to the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.log4j.Logger logger
Constructor Detail

RestErrorHandler

public RestErrorHandler()
Method Detail

handleExceptions

protected void handleExceptions(org.jboss.netty.channel.MessageEvent messageEvent,
                                java.lang.Exception exception)
Exceptions specific to each operation is handled in the corresponding subclass. At this point we don't know the reason behind this exception.

Parameters:
exception -

writeErrorResponse

public static void writeErrorResponse(org.jboss.netty.channel.MessageEvent messageEvent,
                                      org.jboss.netty.handler.codec.http.HttpResponseStatus status,
                                      java.lang.String message)
Writes all error responses to the client. TODO REST-Server 1. collect error stats

Parameters:
messageEvent - - for retrieving the channel details
status - - error code
message - - error message


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu