[Hawkular-dev] [metrics] Consistent error replies from REST API

Thomas Segismont tsegismo at redhat.com
Thu Mar 5 12:32:34 EST 2015


Hi,

There's a growing portion of application code in the metrics REST API 
which returns errors (with whichever HTTP status) in the following form:

====
{"errorMsg": "blah"}
====

Whether this format is nice or suitable is not the purpose of this 
message. I just want to draw your attention to the fact that being 
consistent regarding error reporting is important.

In this regard, I've added a new ExceptionMapper for 
org.jboss.resteasy.spi.ReaderException[2] instances. So now, not only 
application errors conform to the format above, but also errors coming 
from payload parsing.

Regards,
Thomas

[1] 
http://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html_single/#builtinException


More information about the hawkular-dev mailing list