Class GXOutboundErrorResponse
- java.lang.Object
-
- org.gcube.common.gxrest.response.outbound.GXOutboundErrorResponse
-
public class GXOutboundErrorResponse extends Object
An outbound error response message for applications.- Author:
- Manuele Simi (ISTI CNR)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidthrowErrorCode(ErrorCode code)Throws the error code to the client.static voidthrowErrorCode(ErrorCode code, javax.ws.rs.core.Response.Status status)Returns the error code to the client with the HTTP status.static voidthrowException(Exception exception)Throws the exception to the client.static voidthrowException(Exception exception, javax.ws.rs.core.Response.Status status)Throws the exception to the client.static voidthrowExceptionWithTrace(Exception exception, int keepLines)Throws the exception to the client.static voidthrowExceptionWithTrace(Exception exception, int keepLines, javax.ws.rs.core.Response.Status status)Throws the exception to the client.static voidthrowExceptionWithTrace(Exception exception, int keepLines, javax.ws.rs.core.Response.Status status, javax.ws.rs.core.MediaType type)Throws the exception to the client.static voidthrowHTTPErrorStatus(javax.ws.rs.core.Response.Status status, String message)Returns the HTTP status to the client as error.
-
-
-
Method Detail
-
throwException
public static void throwException(Exception exception)
Throws the exception to the client.- Parameters:
exception-
-
throwException
public static void throwException(Exception exception, javax.ws.rs.core.Response.Status status)
Throws the exception to the client.- Parameters:
exception-
-
throwExceptionWithTrace
public static void throwExceptionWithTrace(Exception exception, int keepLines, javax.ws.rs.core.Response.Status status)
Throws the exception to the client.- Parameters:
exception-keepLines- number of lines in the stacktrace to keep (max is 5)
-
throwExceptionWithTrace
public static void throwExceptionWithTrace(Exception exception, int keepLines, javax.ws.rs.core.Response.Status status, javax.ws.rs.core.MediaType type)
Throws the exception to the client.- Parameters:
exception-keepLines- number of lines in the stacktrace to keep (max is 5)type- the media type associated to the response
-
throwExceptionWithTrace
public static void throwExceptionWithTrace(Exception exception, int keepLines)
Throws the exception to the client.- Parameters:
exception-keepLines- number of lines in the stacktrace to keep (max is 5)
-
throwErrorCode
public static void throwErrorCode(ErrorCode code)
Throws the error code to the client.- Parameters:
code-
-
throwErrorCode
public static void throwErrorCode(ErrorCode code, javax.ws.rs.core.Response.Status status)
Returns the error code to the client with the HTTP status.- Parameters:
code-status-
-
throwHTTPErrorStatus
public static void throwHTTPErrorStatus(javax.ws.rs.core.Response.Status status, String message)Returns the HTTP status to the client as error.- Parameters:
status-message-
-
-