Class ServiceExceptionMapper
java.lang.Object
com.atlassian.confluence.rest.v2.api.exception.ServiceExceptionMapper
- All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<Exception>
- Direct Known Subclasses:
RestExceptionMapper
public abstract class ServiceExceptionMapper
extends Object
implements jakarta.ws.rs.ext.ExceptionMapper<Exception>
Ensures
ServiceException
s thrown by REST resources are converted into appropriate RestError
s before
returning the Response
.
To use this in your plugin, you should implement this class in the same package as your REST resources and annotate
it with Provider
.
OSGi exported as public API to allow marketplace partners to leverage Atlassian-defined REST error handling.
- Since:
- 9.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
This method exists to remind developers that they must annotate the implementing class withProvider
.final jakarta.ws.rs.core.Response
toResponse
(Exception exception)
-
Constructor Details
-
ServiceExceptionMapper
public ServiceExceptionMapper()
-
-
Method Details
-
toResponse
- Specified by:
toResponse
in interfacejakarta.ws.rs.ext.ExceptionMapper<Exception>
-
_annotateThisClassWithProvider
protected abstract void _annotateThisClassWithProvider()This method exists to remind developers that they must annotate the implementing class withProvider
. The implementing class must also be placed in a package scanned by Atlassian-REST for REST modules.
-