
| Modifier and Type | Field and Description |
|---|---|
private javax.ws.rs.core.HttpHeaders |
headers |
private static org.slf4j.Logger |
LOG |
private Boolean |
showStackTrace |
private static Set<javax.ws.rs.core.MediaType> |
SUPPORTED_MEDIA_TYPES
Supported media types.
|
private javax.ws.rs.core.UriInfo |
uriInfo |
| Constructor and Description |
|---|
JsonExceptionMapper() |
| Modifier and Type | Method and Description |
|---|---|
private javax.ws.rs.core.MediaType |
getAppropriateMediaType()
Determines the appropriate media type based on what is requested.
|
private void |
log(Throwable exception)
Log the exception if it is not NotFoundException and only use warn if it is a
client error.
|
void |
setContextData(javax.ws.rs.core.HttpHeaders headers,
javax.ws.rs.core.UriInfo uriInfo,
boolean showStackTrace)
This sets the context data so the mapper can be unit tested.
|
void |
setDebugFlags()
If the show request URI or show stack trace are not defined, it will default
to whether the current logger is on debug mode or not.
|
javax.ws.rs.core.Response |
toResponse(Throwable exception) |
private static final org.slf4j.Logger LOG
private static final Set<javax.ws.rs.core.MediaType> SUPPORTED_MEDIA_TYPES
@Context private javax.ws.rs.core.HttpHeaders headers
@Value(value="${microservice.show_stack_trace:#{null}}")
private Boolean showStackTrace
@Context private javax.ws.rs.core.UriInfo uriInfo
private javax.ws.rs.core.MediaType getAppropriateMediaType()
private void log(Throwable exception)
exception - public void setContextData(javax.ws.rs.core.HttpHeaders headers,
javax.ws.rs.core.UriInfo uriInfo,
boolean showStackTrace)
@PostConstruct public void setDebugFlags()
Copyright © 2012–2018 Trajano. All rights reserved.