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

Heiko W.Rupp hrupp at redhat.com
Fri Mar 6 06:11:19 EST 2015


> Am 06.03.2015 um 11:07 schrieb Juraci Paixão Kröhling <jpkroehling at redhat.com>:
> For scenarios where things were really expected to be there but
> aren't, exceptions are fine. For scenarios where the user asked for
> something that didn't exist, input checking and promptly returning a
> 404 makes more sense, IMO.

I fear that this will lead to pretty unreadable code with many blocks of 

return Response.Builder.notFound(new StringEntity("this is my message %s",bla)).type("application/json").build()

While we do (only) application/json right now, this will get more complex with more (custom) media types.




More information about the hawkular-dev mailing list