create middleware error handling tests