|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimple.http.serve.ErrorReport
public class ErrorReport
The ErrorReport
is used to describe HTTP errors.
Reporting the various HTTP errors requires that status codes
and textual descriptions of the errors are provided. This
will pair a provided status code with a short description of
the error that HTTP status code represents as outlined by
RFC 2612 section 6.1.1.
The getCause
method will provide a description
of the error using the printStackTrace
method.
This enables the cause of the error to be identified within
the source code of the file that threw the exception.
Field Summary | |
---|---|
protected static java.util.ResourceBundle |
error
This is used to load the Error.properties file for a list of the matching HTTP error messages. |
Constructor Summary | |
---|---|
ErrorReport(java.lang.Throwable cause,
int code)
Constructor for the ErrorReport object. |
Method Summary | |
---|---|
java.lang.String |
getCause()
This is used to acquire a detailed message describing the cause of the error. |
int |
getCode()
Returns the HTTP status code that this report represents. |
java.lang.String |
getText()
Returns a short description of what caused this report. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.ResourceBundle error
Constructor Detail |
---|
public ErrorReport(java.lang.Throwable cause, int code)
ErrorReport
object. This
will create an instance that uses the exception and the
HTTP status code provided to describe the error event.
cause
- this is the exception that caused the errorcode
- this is the HTTP status code of the errorMethod Detail |
---|
public int getCode()
getCode
in interface Report
public java.lang.String getText()
getText
in interface Report
public java.lang.String getCause()
printStackTrace
method.
getCause
in interface Report
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |