Closed aesteve closed 9 years ago
And provide a way to map them on a specific content-type
In VertxMVC :
router.failureHandler(failureHandlerRegistry)
FailureHandlerRegistry :
public void handle(RoutingContext context) { String contentType = context.get("best-content-type"); PayloadMarshaller marshaller = marshallers.get(contentType); if (marshaller == null) { defaultErrorHandler.handle(context); // displays an html error page } else { marshaller.marshallError(context.failure()); } }
And in PayloadMarshaller interface, add a marshallError(Throwable t) method.
PayloadMarshaller
marshallError(Throwable t)
And add the implementation into JSONPayloadMarshaller.
Also, provide a configuration option to tell the framwork to include stacktraces in errors or not.
implemented -> test it
And provide a way to map them on a specific content-type
In VertxMVC :
router.failureHandler(failureHandlerRegistry)
FailureHandlerRegistry :
And in
PayloadMarshaller
interface, add amarshallError(Throwable t)
method.And add the implementation into JSONPayloadMarshaller.
Also, provide a configuration option to tell the framwork to include stacktraces in errors or not.