Work in progress
Exceptions thrown by JAXRS are serialized to strings (JSON for example) but not in a nice format. This library provides error mapping to a standardized Errors object or list.
- Defines fixed error classes
- Provides simple runtime exception handling in JAXRS.
Fixed classes makes sure that all applications use the same format across services.
TODO add support for XML
Expected the jackson library on the classpath:
- com.fasterxml.jackson.jaxrs
- com.fasterxml.jackson.jaxrs.annotations
Include dependency:
dependencies {
compile "com.wijdemans:jaxrs-jetty-error-handling:0.0.1"
}
Add to container:
class Main {
private ResourceConfig createResourceConfig () {
final ResourceConfig rc = new ResourceConfig();
rc.register(JaxRsErrorMapper.class);
return rc;
}
}