added tests to verify that passing error and non-error messages through middleware hooks works
Merge pull request #2498 from alabid/gh-2441

added tests to verify that passing error and non-error messages through ...