It is currently the case that for any error handled by Kask, a JSON-encoded HTTP problem will be returned. There exists however the possibility that errors occurring lower in the Golang HTTP stack, before control is handed off to application code, can result in text-formatted (Content-Type: text/plain) errors. An excessively long set of headers and/or request URL will return a 431, for example:
HTTP/1.1 431 Request Header Fields Too Large Content-Type: text/plain Connection: close 431 Request Header Fields Too Large
RESTBagOStuff seems to parse the body as JSON if $this->extendedErrorBodyFields !== , which based on the example configuration in the docstrings will be true. I don't expect these errors to happen frequently, and perhaps it already fails gracefully and Does The Right thing if decoding of the body doesn't succeed. Can we confirm whether this is the case?