org.loom.exception
Class HttpException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.loom.exception.HttpException
All Implemented Interfaces:
java.io.Serializable, HttpThrowable
Direct Known Subclasses:
RuntimeFileNotFoundException

public class HttpException
extends java.lang.RuntimeException
implements HttpThrowable

This exception can be used at any moment to return the specified HTTP error code to the browser. The browser will be pesented with a generic HTTP error page, but the system log will log the real cause (the provided error message)

See Also:
Serialized Form

Constructor Summary
HttpException(int httpError, java.lang.String message)
           
HttpException(int httpError, java.lang.String message, java.lang.Throwable cause)
           
HttpException(int httpError, java.lang.Throwable cause)
           
 
Method Summary
 int getHttpError()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.loom.exception.HttpThrowable
getCause
 

Constructor Detail

HttpException

public HttpException(int httpError,
                     java.lang.String message)
Parameters:
httpError - the http error code to be returned to the browser
message - the error message that will be logged in the system log (not presented to the browser)

HttpException

public HttpException(int httpError,
                     java.lang.String message,
                     java.lang.Throwable cause)
Parameters:
httpError - the http error code to be returned to the browser
message - the error message that will be logged in the system log (not presented to the browser)

HttpException

public HttpException(int httpError,
                     java.lang.Throwable cause)
Parameters:
httpError - the http error code to be returned to the browser
cause - the cause of this exception
Method Detail

getHttpError

public int getHttpError()
Specified by:
getHttpError in interface HttpThrowable
Returns:
the HTTP error code that should be returned to the browser for this error.