-
Notifications
You must be signed in to change notification settings - Fork 2
tojson errorhandler
jarnoux edited this page Jun 23, 2013
·
4 revisions
This middleware is an error handler middleware that outputs an error to the response with an appropriate html status code. The response is a JSON plain text string that has the following format
{
"type": "MyError", # the error constructor name
"status": 404, # the HTTP status generated for that type
"message": "This is my Error" # the error message
}"tojson-errorhandler": {
"statuses": {
"MongoError": 409,
"InvalidCredentialsError": 401
}
}statuses. This member maps errors constructor names to an http status to send along the response