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:
parent
bf3078cd46
commit
9cedd1a2b9
1 changed files with 7 additions and 1 deletions
|
@ -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' ||
|
||||
|
|
Loading…
Reference in a new issue