Class GXOutboundErrorResponse
java.lang.Object
org.gcube.common.gxrest.response.outbound.GXOutboundErrorResponse
An outbound error response message for applications.
- Author:
- Manuele Simi (ISTI CNR)
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidthrowErrorCode(ErrorCode code) Throws the error code to the client.static voidthrowErrorCode(ErrorCode code, jakarta.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, jakarta.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, jakarta.ws.rs.core.Response.Status status) Throws the exception to the client.static voidthrowExceptionWithTrace(Exception exception, int keepLines, jakarta.ws.rs.core.Response.Status status, jakarta.ws.rs.core.MediaType type) Throws the exception to the client.static voidthrowHTTPErrorStatus(jakarta.ws.rs.core.Response.Status status, String message) Returns the HTTP status to the client as error.
-
Method Details
-
throwException
Throws the exception to the client.- Parameters:
exception- the exception to throw
-
throwException
Throws the exception to the client.- Parameters:
exception- the exception to throwstatus- the HTTP status
-
throwExceptionWithTrace
public static void throwExceptionWithTrace(Exception exception, int keepLines, jakarta.ws.rs.core.Response.Status status) Throws the exception to the client.- Parameters:
exception- the exception to throwkeepLines- number of lines in the stacktrace to keep (max is 5)status- the HTTP status
-
throwExceptionWithTrace
public static void throwExceptionWithTrace(Exception exception, int keepLines, jakarta.ws.rs.core.Response.Status status, jakarta.ws.rs.core.MediaType type) Throws the exception to the client.- Parameters:
exception- the exception to throwkeepLines- number of lines in the stacktrace to keep (max is 5)status- the HTTP statustype- the media type associated to the response
-
throwExceptionWithTrace
Throws the exception to the client.- Parameters:
exception- the exception to throwkeepLines- number of lines in the stacktrace to keep (max is 5)
-
throwErrorCode
Throws the error code to the client.- Parameters:
code- the error code
-
throwErrorCode
Returns the error code to the client with the HTTP status.- Parameters:
code- the error codestatus- the HTTP status
-
throwHTTPErrorStatus
Returns the HTTP status to the client as error.- Parameters:
status- the HTTP statusmessage- the message
-