Open original-brownbear opened 4 years ago
Pinging @elastic/es-core-infra (:Core/Infra/Core)
Relates https://github.com/elastic/elasticsearch/pull/61485 which was caused by this subtle difference where it resulted in some pointless test.
+1 to a consistent error
I'm adding the help wanted
since this is still an issue, and should be relatively easy to fix, but has not been a priority since it is a minor inconsistency.
Hello @rjernst @jaymode @original-brownbear , can I work on this issue?
Optimizing
BytesReference
parsing in #61447 revealed a subtle bug in x-content parsing.The following test:
will actually pass until the last line which will throw:
So for reading from streams, we simply read empty map when the type is off but when reading from a byte array we (in my opinion correctly) throw an exception. I think we should throw that same exception when reading from a stream of the wrong content type shouldn't we?