, - coustom ExceptionMapper , .
.
class: org.glassfish.jersey.server.ServerRuntime, methed: mapException
...
final long timestamp = tracingLogger.timestamp(ServerTraceEvent.EXCEPTION_MAPPING);
**ExceptionMapper mapper = runtime.exceptionMappers.findMapping(throwable);**
if (mapper != null) {
request.getRequestEventBuilder().setExceptionMapper(mapper);
...
null, ExceptionMapper .
class: org.glassfish.jersey.internal.ExceptionMapperFactory methed: ExceptionMapperFactory
Exception Mapper: ( Exception : java.lang.Exception)
org.glassfish.jersey.server.mvc.internal.ErrorTemplateExceptionMapper @6473fc2, java.lang.Exception
...
com.baidu.ssp.web.ws.exception.BaseExceptionMapper @7a84639c, java.lang.Exception
MvcFeature:
@Override
public boolean configure(final FeatureContext context) {
final Configuration config = context.getConfiguration();
if (!config.isRegistered(ErrorTemplateExceptionMapper.class)) {
context.register(ErrorTemplateExceptionMapper.class);
context.register(new MvcBinder());
return true;
}
return false;
}
ErrorTemplateExceptionMapper ExceptionMapper.
, MapperException:
ExceptionMapper
ExceptionMapper
,
ExceptionMapper.