3 ms·
I implemented the older RFC in Java, doing a few fun things: 1. API were ultimately expected to throw a ProblemDetailsException. A response filter would catch
by dwaite 4y ago
I implemented the older RFC in Java, doing a few fun things:
1. API were ultimately expected to throw a ProblemDetailsException. A response filter would catch and wrap other unexpected throwables into a problem details exception.
2. The resulting exception handler preferred [a/p+j, a/j, a/p+x, a/x, t/h] media type ordering (with abbreviated names), which meant that a browser would get HTML errors while something like curl would get application/problem+json
I considered a XSLT on the XML output, but that just seemed like going for bonus points.