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

...middleware hooks works