fixes bug 1089897 - propagate 400 errors from middleware

@AdrianGaudebert r?