From d5698a8ff93315c38757b269af50a5f2729bfe47 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 15 Dec 2016 17:48:29 +0000 Subject: [PATCH] Add logging for a few exceptions --- resources/l10n/template.pot | 16 ++++++++-------- src/gui/query/get_game_data_query.h | 2 ++ src/gui/query/metadata_query.h | 2 ++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/resources/l10n/template.pot b/resources/l10n/template.pot index 3eeec845..d1752ed7 100644 --- a/resources/l10n/template.pot +++ b/resources/l10n/template.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: LOOT 0.10.1\n" "Report-Msgid-Bugs-To: https://github.com/loot/loot/issues\n" -"POT-Creation-Date: 2016-12-14 21:55+0000\n" +"POT-Creation-Date: 2016-12-15 18:04+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -635,14 +635,14 @@ msgstr "" msgid "Parsing, merging and evaluating metadata..." msgstr "" -#: src/gui/query/get_game_data_query.h:79 +#: src/gui/query/get_game_data_query.h:80 msgid "" "An error occurred while parsing the masterlist: %1%. This probably happened " "because an update to LOOT changed its metadata syntax support. Try updating " "your masterlist to resolve the error." msgstr "" -#: src/gui/query/get_game_data_query.h:93 +#: src/gui/query/get_game_data_query.h:95 msgid "" "An error occurred while parsing the userlist: %1%. This probably happened " "because an update to LOOT changed its metadata syntax support. Your user " @@ -657,25 +657,25 @@ msgid "" "[LOOT's website](https://loot.github.io/)." msgstr "" -#: src/gui/query/metadata_query.h:90 src/gui/query/metadata_query.h:91 +#: src/gui/query/metadata_query.h:91 src/gui/query/metadata_query.h:92 msgid "N/A: No masterlist present" msgstr "" -#: src/gui/query/metadata_query.h:93 src/gui/query/metadata_query.h:94 +#: src/gui/query/metadata_query.h:95 src/gui/query/metadata_query.h:96 msgid "Unknown: Git repository missing" msgstr "" -#: src/gui/query/metadata_query.h:117 +#: src/gui/query/metadata_query.h:119 msgid "" "A global message contains a condition that could not be evaluated. Details: " "%1%" msgstr "" -#: src/gui/query/metadata_query.h:143 src/backend/plugin/plugin_sorter.cpp:217 +#: src/gui/query/metadata_query.h:145 src/backend/plugin/plugin_sorter.cpp:217 msgid "\"%1%\" contains a condition that could not be evaluated. Details: %2%" msgstr "" -#: src/gui/query/metadata_query.h:174 src/gui/query/metadata_query.h:175 +#: src/gui/query/metadata_query.h:176 src/gui/query/metadata_query.h:177 msgid "(edited)" msgstr "" diff --git a/src/gui/query/get_game_data_query.h b/src/gui/query/get_game_data_query.h index 1b4f5d37..0d9e93ee 100644 --- a/src/gui/query/get_game_data_query.h +++ b/src/gui/query/get_game_data_query.h @@ -75,6 +75,7 @@ private: try { state_.getCurrentGame().GetMasterlist().Load(state_.getCurrentGame().MasterlistPath()); } catch (std::exception &e) { + BOOST_LOG_TRIVIAL(error) << "An error occurred while parsing \"" << state_.getCurrentGame().MasterlistPath() << "\": " << e.what(); state_.getCurrentGame().GetMasterlist().AppendMessage(Message(MessageType::error, (boost::format(boost::locale::translate( "An error occurred while parsing the masterlist: %1%. " "This probably happened because an update to LOOT changed " @@ -89,6 +90,7 @@ private: try { state_.getCurrentGame().GetUserlist().Load(state_.getCurrentGame().UserlistPath()); } catch (std::exception &e) { + BOOST_LOG_TRIVIAL(error) << "An error occurred while parsing \"" << state_.getCurrentGame().UserlistPath() << "\": " << e.what(); state_.getCurrentGame().GetUserlist().AppendMessage(Message(MessageType::error, (boost::format(boost::locale::translate( "An error occurred while parsing the userlist: %1%. " "This probably happened because an update to LOOT changed " diff --git a/src/gui/query/metadata_query.h b/src/gui/query/metadata_query.h index bf212f74..a8dbb962 100644 --- a/src/gui/query/metadata_query.h +++ b/src/gui/query/metadata_query.h @@ -87,9 +87,11 @@ protected: masterlistNode["revision"] = info.revision_id; masterlistNode["date"] = info.revision_date; } catch (FileAccessError &) { + BOOST_LOG_TRIVIAL(warning) << "No masterlist present at " << state_.getCurrentGame().MasterlistPath(); masterlistNode["revision"] = translate("N/A: No masterlist present").str(); masterlistNode["date"] = translate("N/A: No masterlist present").str(); } catch (GitStateError &) { + BOOST_LOG_TRIVIAL(warning) << "Not a Git repository: " << state_.getCurrentGame().MasterlistPath().parent_path(); masterlistNode["revision"] = translate("Unknown: Git repository missing").str(); masterlistNode["date"] = translate("Unknown: Git repository missing").str(); }