Class ServiceException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.atlassian.confluence.api.service.exceptions.ServiceException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BadRequestException
,ConflictException
,GoneException
,InternalServerException
,LicenseUnavailableException
,NotAuthenticatedException
,NotFoundException
,NotImplementedServiceException
,PermissionException
,ReadOnlyException
,SeeOtherException
@ExperimentalApi public class ServiceException extends RuntimeException
All thrown API Service-level exceptions should extend this exception.Every ServiceException subclass should have a clean mapping to HTTP response statuses and messages.
Services may throw this exception to wrap general unexpected exceptions; instances of this base class (rather than a subclass) map to a http 500 error.
ServiceExceptions can handle the case where multiple validation errors occur - use the
constructor accepting ValidationResult
, and they will all be returned to the client.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServiceException()
ServiceException(String message)
ServiceException(String message, ValidationResult validationResult)
ServiceException(String message, Throwable cause)
ServiceException(Throwable throwable)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.atlassian.fugue.Option<ValidationResult>
getOptionalValidationResult()
Deprecated.since 7.0.1.Optional<ValidationResult>
optionalValidationResult()
String
toString()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
ServiceException
public ServiceException()
-
ServiceException
public ServiceException(String message)
-
ServiceException
public ServiceException(Throwable throwable)
-
ServiceException
public ServiceException(String message, ValidationResult validationResult)
-
-
Method Detail
-
getOptionalValidationResult
@Deprecated public com.atlassian.fugue.Option<ValidationResult> getOptionalValidationResult()
Deprecated.since 7.0.1. UseoptionalValidationResult()
-
optionalValidationResult
public Optional<ValidationResult> optionalValidationResult()
- Since:
- 7.0.1
-
-