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 Details

    • throwException

      public static void throwException(Exception exception)
      Throws the exception to the client.
      Parameters:
      exception - the exception to throw
    • throwException

      public static void throwException(Exception exception, jakarta.ws.rs.core.Response.Status status)
      Throws the exception to the client.
      Parameters:
      exception - the exception to throw
      status - 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 throw
      keepLines - 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 throw
      keepLines - number of lines in the stacktrace to keep (max is 5)
      status - the HTTP status
      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 - the exception to throw
      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 - the error code
    • throwErrorCode

      public static void throwErrorCode(ErrorCode code, jakarta.ws.rs.core.Response.Status status)
      Returns the error code to the client with the HTTP status.
      Parameters:
      code - the error code
      status - the HTTP status
    • throwHTTPErrorStatus

      public static void throwHTTPErrorStatus(jakarta.ws.rs.core.Response.Status status, String message)
      Returns the HTTP status to the client as error.
      Parameters:
      status - the HTTP status
      message - the message