[Libreoffice-commits] online.git: loolwsd/ChildProcessSession.cpp loolwsd/LOOLKit.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Thu May 12 01:56:45 UTC 2016
loolwsd/ChildProcessSession.cpp | 5 +++++
loolwsd/LOOLKit.cpp | 6 ++++++
2 files changed, 11 insertions(+)
New commits:
commit a35a000da88b0b7991c5471dd0475652d137e5ea
Author: Ashod Nakashian <ashod.nakashian at 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 <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at 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;
More information about the Libreoffice-commits
mailing list