Permalink
Browse files

CriticalErrorDialog: Don't tell users to look for log files that don'…

…t exist.
  • Loading branch information...
1 parent e244e40 commit a9a7476d2d66fb4d589ba5797b30797d58ff0124 @dscharrer dscharrer committed Apr 24, 2012
Showing with 15 additions and 9 deletions.
  1. +15 −9 src/io/log/CriticalLogger.cpp
@@ -19,29 +19,35 @@
#include "io/log/CriticalLogger.h"
-#include "platform/Dialog.h"
-#include "platform/Platform.h"
-
#include "core/Config.h"
#include "core/Version.h"
+#include "io/fs/Filesystem.h"
+#include "platform/Dialog.h"
+#include "platform/Platform.h"
namespace logger {
CriticalErrorDialog::~CriticalErrorDialog() {
+
if(!errorString.empty()) {
std::string fullText = errorString;
- if(!config.paths.config.string().empty())
- fullText += "\n\nYou might want to take a look at arx.log under \"" + config.paths.config.string() + "\" for more details.";
+
+ if(fs::exists(config.paths.user / "arx.log")) {
+ fullText += "\n\nYou might want to take a look at arx.log under \""
+ + config.paths.user.string() + "\" for more details.";
+ }
+
dialog::showError(fullText, "Critical Error - " + version);
}
}
-void CriticalErrorDialog::log(const Source & file, int line, Logger::LogLevel level, const std::string & str) {
- ARX_UNUSED(file);
- ARX_UNUSED(line);
+void CriticalErrorDialog::log(const Source & file, int line, Logger::LogLevel level,
+ const std::string & str) {
+ ARX_UNUSED(file), ARX_UNUSED(line);
- if(level == Logger::Critical && errorString.empty())
+ if(level == Logger::Critical && errorString.empty()) {
errorString = str;
+ }
}
} // namespace logger

0 comments on commit a9a7476

Please sign in to comment.