mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Handled permissions error in file storage adapter
no issue - trying to read a file without the correct permissions would cause a 500 error - this commit handles the error code and returns an appropriate response
This commit is contained in:
parent
303def2045
commit
2dd374043d
1 changed files with 4 additions and 0 deletions
|
@ -175,6 +175,10 @@ class LocalFileStore extends StorageBase {
|
|||
return reject(new common.errors.BadRequestError({err: err}));
|
||||
}
|
||||
|
||||
if (err.code === 'EACCES') {
|
||||
return reject(new common.errors.NoPermissionError({err: err}));
|
||||
}
|
||||
|
||||
return reject(new common.errors.GhostError({
|
||||
err: err,
|
||||
message: common.i18n.t('errors.errors.cannotReadImage', {img: options.path})
|
||||
|
|
Loading…
Add table
Reference in a new issue