2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Imporve handling of SQLITE_READONLY

closes #3659
- added alternate context/help for SQLITE_READONY error to
errors.logError()
This commit is contained in:
Sebastian Gierlinger 2014-08-08 11:16:51 +02:00
parent bf3078cd46
commit 9cedd1a2b9

View file

@ -95,7 +95,13 @@ errors = {
msgs;
err = _.isString(err) ? err : (_.isObject(err) ? err.message : 'An unknown error occurred.');
// Overwrite error to provide information that this is probably a permission problem
// TODO: https://github.com/TryGhost/Ghost/issues/3687
if (err.indexOf('SQLITE_READONLY') !== -1) {
context = "Your database is in read only mode. Visitors can read your blog, but you can't log in or add posts.";
help = "Check your database file and make sure that file owner and permissions are correct.";
}
// TODO: Logging framework hookup
// Eventually we'll have better logging which will know about envs
if ((process.env.NODE_ENV === 'development' ||