Class GXOutboundErrorResponse


  • public class GXOutboundErrorResponse
    extends Object
    An outbound error response message for applications.
    Author:
    Manuele Simi (ISTI CNR)
    • Method Detail

      • throwException

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

        public static void throwException​(Exception exception,
                                          jakarta.ws.rs.core.Response.Status status)
        Throws the exception to the client.
        Parameters:
        exception -
      • throwExceptionWithTrace

        public static void throwExceptionWithTrace​(Exception exception,
                                                   int keepLines,
                                                   jakarta.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,
                                                   jakarta.ws.rs.core.Response.Status status,
                                                   jakarta.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,
                                          jakarta.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​(jakarta.ws.rs.core.Response.Status status,
                                                String message)
        Returns the HTTP status to the client as error.
        Parameters:
        status -
        message -