Skip to content

Commit 6a5dc5c

Browse files
committed
ah ok get those generic mongo error codes
1 parent 2b7ea90 commit 6a5dc5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const index = function (req, res, next) {
101101

102102
function createExpressError(err) {
103103
let error = {
104-
statusCode: err.statusCode ?? err.status ?? 500,
104+
statusCode: err.statusCode ?? err.status ?? err.code ?? 500,
105105
statusMessage: err.statusMessage ?? err.message ?? "There was an error that prevented this request from completing successfully."
106106
}
107107
if (err.code === 11000) {

0 commit comments

Comments
 (0)