Class NotFoundExceptionMapper
java.lang.Object
ubic.gemma.rest.providers.AbstractExceptionMapper<jakarta.ws.rs.NotFoundException>
ubic.gemma.rest.providers.NotFoundExceptionMapper
- All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<jakarta.ws.rs.NotFoundException>
@Provider
@Component
public class NotFoundExceptionMapper
extends AbstractExceptionMapper<jakarta.ws.rs.NotFoundException>
This mapper ensures that raised
NotFoundException throughout the API contain well-formed ResponseErrorObject
entity.
Normally, this would be handled by WebApplicationExceptionMapper, but we also want to expose the stack trace
in the case of a missing entity.
- Author:
- poirigui
-
Field Summary
Fields inherited from class AbstractExceptionMapper
log -
Constructor Summary
ConstructorsConstructorDescriptionNotFoundExceptionMapper(String hostUrl, Future<io.swagger.v3.oas.models.OpenAPI> spec, BuildInfo buildInfo) -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.ws.rs.core.Response.StatusgetStatus(jakarta.ws.rs.NotFoundException exception) Translate the exception to an HTTPResponse.Status.protected WellComposedErrorBodygetWellComposedErrorBody(jakarta.ws.rs.NotFoundException exception) Obtain aWellComposedErrorBodyfor the exception.Methods inherited from class AbstractExceptionMapper
getResponseBuilder, toResponse
-
Constructor Details
-
NotFoundExceptionMapper
-
-
Method Details
-
getStatus
protected jakarta.ws.rs.core.Response.Status getStatus(jakarta.ws.rs.NotFoundException exception) Description copied from class:AbstractExceptionMapperTranslate the exception to an HTTPResponse.Status.- Specified by:
getStatusin classAbstractExceptionMapper<jakarta.ws.rs.NotFoundException>
-
getWellComposedErrorBody
Description copied from class:AbstractExceptionMapperObtain aWellComposedErrorBodyfor the exception.- Overrides:
getWellComposedErrorBodyin classAbstractExceptionMapper<jakarta.ws.rs.NotFoundException>
-