0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Merge pull request #4833 from jaswilli/issue-4735

Format database-related error responses
This commit is contained in:
Hannah Wolfe 2015-01-22 16:05:55 +01:00
commit 2c1d662517

View file

@ -193,6 +193,15 @@ errors = {
return this.rejectError(error);
}
// handle database errors
if (error.code && (error.errno || error.detail)) {
error.db_error_code = error.code;
error.type = 'DatabaseError';
error.code = 500;
return this.rejectError(error);
}
return this.rejectError(new this.InternalServerError(error));
},