loolwsd/ChildProcessSession.cpp | 5 +++++ loolwsd/LOOLKit.cpp | 6 ++++++ 2 files changed, 11 insertions(+)
New commits: commit a35a000da88b0b7991c5471dd0475652d137e5ea Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Wed May 11 21:16:10 2016 -0400 loolwsd: proper error handling of document load failure Change-Id: Ide14609b18b5dad9ac4451ab2dbbbe0544c60b47 Reviewed-on: https://gerrit.libreoffice.org/24908 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp index 5ea3da6..21c2aad 100644 --- a/loolwsd/ChildProcessSession.cpp +++ b/loolwsd/ChildProcessSession.cpp @@ -423,6 +423,11 @@ bool ChildProcessSession::_handleInput(const char *buffer, int length) } _isDocLoaded = loadDocument(buffer, length, tokens); + if (!_isDocLoaded) + { + sendTextFrame("error: cmd=load kind=faileddocloading"); + } + return _isDocLoaded; } else if (!_isDocLoaded) diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp index 309cc65..183768b 100644 --- a/loolwsd/LOOLKit.cpp +++ b/loolwsd/LOOLKit.cpp @@ -901,6 +901,7 @@ private: catch (const std::exception& exc) { Log::error("Exception while loading [" + uri + "] : " + exc.what()); + return nullptr; } // Done loading, let the next one in (if any). @@ -991,8 +992,10 @@ private: // Checking if wrong password or no password was reason for failure. if (_isDocPasswordProtected) { + Log::info("Document [" + uri + "] is password protected."); if (!_haveDocPassword) { + Log::info("No password provided for password-protected document [" + uri + "]."); std::string passwordFrame = "passwordrequired:"; if (_docPasswordType == PasswordType::ToView) passwordFrame += "to-view"; @@ -1001,7 +1004,10 @@ private: session->sendTextFrame("error: cmd=load kind=" + passwordFrame); } else + { + Log::info("Wrong password for password-protected document [" + uri + "]."); session->sendTextFrame("error: cmd=load kind=wrongpassword"); + } } return nullptr; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits