I have a problem when my application receives an error from MongoDB server, for example:
Imagine that I do a find in MongoDB but the response from MongoDB Server is an error because of a timeout:
{ $err: "MongoTimeout due to...bla bla bla..." code: 50 }
JacksonDBDecoder is expecting my Java type for example my class "Stuff" (that contains several fields like "price" and "weight"), but when it receives the previous JSON, then there is not any matching fields with "price" and "weight", so the outcome is empty: { }
The empty JSON will be processed by the mongo-java-driver classes (com.mongodb.QueryResultIterator.throwOnQueryFailure exactly) and it will never log the original information "MongoTimeout due to...bla bla bla..." and 50, because the decoder could not understand the JSON from MongoDB Server.
Could you help me to configure mongojack or Jackson to handle this types of responses from MongoDB Server?
Many thanks.
Regards, Paco.