mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Removed Bluebird catch predicate
- We use bluebird inconsistently throughout the codebase now - The original reason why we needed to use it so heavily was so that all promises returned had the bluebird behaviour, including catch predicates - Most other usage is explicit, but this is really hard to detect and hasn't made it to standard promises, so we should get rid of this pattern
This commit is contained in:
parent
09283bd151
commit
10aad8db7e
@ -57,15 +57,16 @@ module.exports = {
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(errors.NotFoundError, function (err) {
|
||||
// CASE: active theme is missing, we don't want to exit because the admin panel will still work
|
||||
err.message = i18n.t('errors.middleware.themehandler.missingTheme', {theme: activeThemeName});
|
||||
logging.error(err);
|
||||
})
|
||||
.catch(function (err) {
|
||||
// CASE: theme threw an odd error, we don't want to exit because the admin panel will still work
|
||||
// This is the absolute catch-all, at this point, we do not know what went wrong!
|
||||
logging.error(err);
|
||||
if (err instanceof errors.NotFoundError) {
|
||||
// CASE: active theme is missing, we don't want to exit because the admin panel will still work
|
||||
err.message = i18n.t('errors.middleware.themehandler.missingTheme', {theme: activeThemeName});
|
||||
logging.error(err);
|
||||
} else {
|
||||
// CASE: theme threw an odd error, we don't want to exit because the admin panel will still work
|
||||
// This is the absolute catch-all, at this point, we do not know what went wrong!
|
||||
logging.error(err);
|
||||
}
|
||||
});
|
||||
},
|
||||
getJSON: require('./to-json'),
|
||||
|
Loading…
Reference in New Issue
Block a user