mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 11:54:33 +03:00
Return correct error codes from storage adapter
no issue - malformed paths such as http://localhost:2368/content/images/2018/02/%c0%af were throwing 500 errors, instead of 500 errors - this code catches the error and handles it correctly
This commit is contained in:
parent
78505f86ef
commit
a4464d0137
@ -123,6 +123,14 @@ class LocalFileStore extends StorageBase {
|
||||
}));
|
||||
}
|
||||
|
||||
if (err.statusCode === 400) {
|
||||
return next(new common.errors.BadRequestError({err: err}));
|
||||
}
|
||||
|
||||
if (err.statusCode === 403) {
|
||||
return next(new common.errors.NoPermissionError({err: err}));
|
||||
}
|
||||
|
||||
return next(new common.errors.GhostError({err: err}));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user