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:
commit
2c1d662517
1 changed files with 9 additions and 0 deletions
|
@ -193,6 +193,15 @@ errors = {
|
||||||
return this.rejectError(error);
|
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));
|
return this.rejectError(new this.InternalServerError(error));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue