mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05: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
81f6b3df1e
commit
03f31bba9d
1 changed files with 8 additions and 0 deletions
|
@ -99,6 +99,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}));
|
return next(new common.errors.GhostError({err: err}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue