report 400 error

fixes #5386 and #5224