Stream: hapi
Topic: Error Codes
Jim Steel (Apr 20 2016 at 03:05):
So I wrote a test case that sends "gibberish" in a create (PUT with Content-Type=application/json+fhir), and it comes back with 500. Should that be 400? I'm happy to lodge an issue, but it feels like I might be missing something
Grahame Grieve (Apr 20 2016 at 05:31):
Jia that's a hard case for a server writer. You claim it's a format, so we pass it yo the lower level parser, and get an exception. Is that a client or a server error? We might get such an exception for several reasons, should we try and differentiate them?
James Agnew (Apr 20 2016 at 11:33):
Yeah, as Grahame points out sometimes it can be hard to tell what's client error vs. server error in cases like that.
That said, I think it's reasonable for the server to at least make some effort to check whether the content is actually XML or JSON. Happy to accept a bug request on that.
Last updated: Apr 12 2022 at 19:14 UTC