Class ServiceException

All Implemented Interfaces:
Serializable, org.kohsuke.stapler.HttpResponse
Direct Known Subclasses:
ServiceException.BadRequestException, ServiceException.ConflictException, ServiceException.ForbiddenException, ServiceException.MethodNotAllowedException, ServiceException.NotFoundException, ServiceException.NotImplementedException, ServiceException.PreconditionRequired, ServiceException.TooManyRequestsException, ServiceException.UnauthorizedException, ServiceException.UnexpectedErrorException, ServiceException.UnprocessableEntityException, ServiceException.UnsupportedMediaTypeException

public class ServiceException extends RuntimeException implements org.kohsuke.stapler.HttpResponse
This exception class to be used by all service methods. An error is represented by a code, in case of HTTP transport it could be http specific error code. Error message is represented by ErrorMessage
Author:
Vivek Pandey
See Also:
  • Field Details

  • Constructor Details

    • ServiceException

      public ServiceException(int status, String message)
    • ServiceException

      public ServiceException(int status, String message, Throwable cause)
    • ServiceException

      public ServiceException(int status, ErrorMessage errorMessage, Throwable cause)
  • Method Details

    • toJson

      public String toJson()
    • generateResponse

      public void generateResponse(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, Object node) throws IOException, javax.servlet.ServletException
      Specified by:
      generateResponse in interface org.kohsuke.stapler.HttpResponse
      Throws:
      IOException
      javax.servlet.ServletException