Package org.apache.olingo.server.api
Class ODataApplicationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.olingo.commons.api.ex.ODataException
org.apache.olingo.server.api.ODataApplicationException
- All Implemented Interfaces:
Serializable
Exception thrown by OData service implementations.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionODataApplicationException
(String msg, int statusCode, Locale locale) Exception in an OData service implementation.ODataApplicationException
(String msg, int statusCode, Locale locale, String oDataErrorCode) Exception in an OData service implementation.ODataApplicationException
(String msg, int statusCode, Locale locale, Throwable cause) Exception in an OData service implementation.ODataApplicationException
(String msg, int statusCode, Locale locale, Throwable cause, String oDataErrorCode) Exception in an OData service implementation. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Locale which was used for the error message.This method will return the error code specified by the application.int
Will return the status code which will be used as a status code for the HTTP response.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ODataApplicationException
Exception in an OData service implementation.- Parameters:
msg
- the text of the exceptionstatusCode
- the HTTP status code of the error response; the default is 500 - Internal Server Errorlocale
- aLocale
to enable translation of error messages- See Also:
-
ODataApplicationException
Exception in an OData service implementation.- Parameters:
msg
- the text of the exceptionstatusCode
- the HTTP status code of the error response; the default is 500 - Internal Server Errorlocale
- aLocale
to enable translation of error messagesoDataErrorCode
- the error code of the exception as defined by the OData standard- See Also:
-
ODataApplicationException
Exception in an OData service implementation.- Parameters:
msg
- the text of the exceptionstatusCode
- the HTTP status code of the error response; the default is 500 - Internal Server Errorlocale
- aLocale
to enable translation of error messagescause
- the cause of this exception- See Also:
-
ODataApplicationException
public ODataApplicationException(String msg, int statusCode, Locale locale, Throwable cause, String oDataErrorCode) Exception in an OData service implementation.- Parameters:
msg
- the text of the exceptionstatusCode
- the HTTP status code of the error response; the default is 500 - Internal Server Errorlocale
- aLocale
to enable translation of error messagescause
- the cause of this exceptionoDataErrorCode
- the error code of the exception as defined by the OData standard- See Also:
-
-
Method Details
-
getStatusCode
public int getStatusCode()Will return the status code which will be used as a status code for the HTTP response. If not set the default is a 500 Internal Server Error.- Returns:
- status code for this exception
-
getLocale
Returns the Locale which was used for the error message. The default is null.- Returns:
- locale used for the error message
-
getODataErrorCode
This method will return the error code specified by the application. The default is null.- Returns:
- the applications error code.
-