0
Fork 0
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:
Daniel Lockyer 2020-03-11 13:27:27 +00:00
parent 303def2045
commit 2dd374043d

View file

@ -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})