From cba86b4b285822308c700a2cd9aa2969f704f00a Mon Sep 17 00:00:00 2001 From: Syping Date: Wed, 9 May 2018 23:15:35 +0200 Subject: [PATCH] better error messages for file ops --- mayu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mayu.cpp b/mayu.cpp index 4fd09ab..94fe964 100644 --- a/mayu.cpp +++ b/mayu.cpp @@ -239,10 +239,14 @@ void mayu::work() if (jsonFile.open(QSaveFile::WriteOnly)) { jsonFile.write(jsonArray); if (!jsonFile.commit()) { - qCritical() << "Failed save result to" << p_jsonFile; + qCritical() << "Failed save result to" << p_jsonFile << "because file can't be saved!"; p_return = 1; } } + else { + qCritical() << "Failed save result to" << p_jsonFile << "because file can't be opened!"; + p_return = 1; + } if (!regainPrivileges()) { p_return = 3; return;