Class AbstractExceptionHandler<T extends Throwable>
java.lang.Object
org.eclipse.dirigible.commons.api.service.AbstractExceptionHandler<T>
- Type Parameters:
T- the generic type
- All Implemented Interfaces:
javax.ws.rs.ext.ExceptionMapper<T>
public abstract class AbstractExceptionHandler<T extends Throwable> extends Object implements javax.ws.rs.ext.ExceptionMapper<T>
The AbstractExceptionHandler is the parent of the exception handlers in RESTful services.
-
Constructor Summary
Constructors Constructor Description AbstractExceptionHandler() -
Method Summary
Modifier and Type Method Description protected abstract org.slf4j.LoggergetLogger()Gets the logger.protected abstract StringgetResponseMessage(T exception)Gets the response message.protected abstract javax.ws.rs.core.Response.StatusgetResponseStatus(T exception)Gets the response status.abstract Class<? extends AbstractExceptionHandler<T>>getType()Gets the type.protected voidlogErrorMessage(org.slf4j.Logger logger, T exception)Log error message.javax.ws.rs.core.ResponsetoResponse(T exception)To response.
-
Constructor Details
-
AbstractExceptionHandler
public AbstractExceptionHandler()
-
-
Method Details
-
toResponse
To response. -
logErrorMessage
Log error message.- Parameters:
logger- the loggerexception- the exception
-
getType
Gets the type.- Returns:
- the type
-
getLogger
protected abstract org.slf4j.Logger getLogger()Gets the logger.- Returns:
- the logger
-
getResponseStatus
Gets the response status.- Parameters:
exception- the exception- Returns:
- the response status
-
getResponseMessage
Gets the response message.- Parameters:
exception- the exception- Returns:
- the response message
-