Class DXAPIException

    • Constructor Detail

      • DXAPIException

        public DXAPIException​(String message,
                              int statusCode)
        Initializes a new exception with the specified message and HTTP status code.
    • Method Detail

      • getInstance

        public static DXAPIException getInstance​(String errorType,
                                                 String errorMessage,
                                                 int statusCode)
        Constructs a DXAPIException of the appropriate subclass based on the errorType. If the errorType is not one of the recognized subclasses, a generic DXAPIException object is returned.
        Parameters:
        errorType - String containing a DNAnexus error type, e.g. InvalidInput
        errorMessage - String indicating the nature of the error.
        statusCode - HTTP status code of the response body.
        Returns:
        Instance of DXAPIException or one of its subclasses.
      • getStatusCode

        public int getStatusCode()
        Returns the HTTP status code associated with the error.