Package io.jenkins.blueocean.commons
Class ServiceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.jenkins.blueocean.commons.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
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
Convenience exception classes modeled after HTTP exceptionsstatic class
static class
static class
static class
static class
static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
final ErrorMessage
static final int
static final int
static final int
static final int
static final int
static final int
final int
static final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionServiceException
(int status, ErrorMessage errorMessage, Throwable cause) ServiceException
(int status, String message) ServiceException
(int status, String message, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionvoid
generateResponse
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, Object node) toJson()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
status
public final int status -
errorMessage
-
BAD_REQUEST
public static final int BAD_REQUEST- See Also:
-
UNAUTHORIZED
public static final int UNAUTHORIZED- See Also:
-
FORBIDDEN
public static final int FORBIDDEN- See Also:
-
NOT_FOUND
public static final int NOT_FOUND- See Also:
-
METHOD_NOT_ALLOWED
public static final int METHOD_NOT_ALLOWED- See Also:
-
UNSUPPORTED_MEDIA_TYPE
public static final int UNSUPPORTED_MEDIA_TYPE- See Also:
-
CONFLICT
public static final int CONFLICT- See Also:
-
UNPROCESSABLE_ENTITY
public static final int UNPROCESSABLE_ENTITY- See Also:
-
PRECONDITION_REQUIRED
public static final int PRECONDITION_REQUIRED- See Also:
-
TOO_MANY_REQUESTS
public static final int TOO_MANY_REQUESTS- See Also:
-
INTERNAL_SERVER_ERROR
public static final int INTERNAL_SERVER_ERROR- See Also:
-
NOT_IMPLEMENTED
public static final int NOT_IMPLEMENTED- See Also:
-
-
Constructor Details
-
ServiceException
-
ServiceException
-
ServiceException
-
-
Method Details
-
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 interfaceorg.kohsuke.stapler.HttpResponse
- Throws:
IOException
javax.servlet.ServletException
-