Documentation
¶
Overview ¶
The meparser package provide a way to parse the Mongo response errors. Their usage is really simple and consiste just in invocate the function Parse passing as parameter the error received by the mongodb operation. For more information see the Parse documentation bellow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Execute the mongo error parser. This function receives as parameter the error received by the mongodb operation and returns a formatted error array that can printed as JSON String.
Note that to facilitate the usage, the status of the returned errors is mapped as a HTTP status.
By now, this just parse the error 121 -> DocumentValidationFailure and the 11000 -> DuplicateKey. All other will returns a generic internal server error message with status 500.
Types ¶
This section is empty.