0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

🐛 do not return error on handleStoreError, throw it!

- ghost hangs if handleStoreError get's called
- we have to throw the error!
This commit is contained in:
kirrg001 2016-11-09 20:56:42 +01:00
parent c749fe2a45
commit cab46894f5

View file

@ -23,8 +23,12 @@ var ExpressBrute = require('express-brute'),
logging = require('../../logging'),
spamConfigKeys = ['freeRetries', 'minWait', 'maxWait', 'lifetime'];
// weird, but true
handleStoreError = function handleStoreError(err) {
return new errors.NoPermissionError({message: 'DB error', err: err});
err.next(new errors.NoPermissionError({
message: 'Unknown error',
err: err.parent ? err.parent : err
}));
};
// This is a global endpoint protection mechanism that will lock an endpoint if there are so many