loolwsd/test/helpers.hpp |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 58bf5bbf37eb339ac46d3841061bd35ed982603c
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Fri Oct 21 22:02:15 2016 -0400

    loolwsd: throw on unexpected errors in getResponseMessage
    
    Tests should read errors and parse them if they are
    expected. Otherwise, we should not ignore them and move
    on, because they are (by the above definition) unexpected.
    
    Change-Id: I9d7a9fb23879044ac4f11461e92c5f6fd6b03fa1
    Reviewed-on: https://gerrit.libreoffice.org/30194
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loolwsd/test/helpers.hpp b/loolwsd/test/helpers.hpp
index cb96a87..3bbac6a 100644
--- a/loolwsd/test/helpers.hpp
+++ b/loolwsd/test/helpers.hpp
@@ -222,6 +222,12 @@ std::vector<char> getResponseMessage(Poco::Net::WebSocket& 
ws, const std::string
 
                 if ((flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != 
Poco::Net::WebSocket::FRAME_OP_CLOSE)
                 {
+                    // Don't ignore errors.
+                    if (LOOLProtocol::matchPrefix("error:", message))
+                    {
+                        throw std::runtime_error(message);
+                    }
+
                     std::cerr << name << "Ignored: " << message << std::endl;
                 }
             }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to