voldemort.server.rest
Class RestServerErrorHandler

java.lang.Object
  extended by voldemort.server.rest.RestServerErrorHandler
Direct Known Subclasses:
RestServerDeleteErrorHandler, RestServerGetErrorHandler, RestServerGetVersionErrorHandler, RestServerPutErrorHandler

public class RestServerErrorHandler
extends java.lang.Object


Field Summary
protected  org.apache.log4j.Logger logger
           
 
Constructor Summary
RestServerErrorHandler()
           
 
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

RestServerErrorHandler

public RestServerErrorHandler()
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