Closed isayme closed 5 years ago
Hi @isayme
I'm not sure this is a good idea, as the values are not necessarily printable strings so users might wind up with random control characters in their output - thanks for the PR though!
Dom
Hi @domodwyer Thanks for your opinion.
What I want to solve is telling developer the exactly field when bson.Marshal
, while current error message cannot do that.
I agree, this is maybe one of the most annoying error when we have complex structs with nested structs containing objectIds ... Thanks for the PR, I was able to find the message easily and debug the name of my field
when insert/update an objectid filed, if invalid id passed, the error message will be:
ObjectIDs must be exactly 12 bytes long (got 0)
.the error message cannot help developer to fingure out the field name.