From 1766cadab69848aa57b15cc3d4a1b7757f88dca6 Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Wed, 5 Jun 2019 16:17:33 +0200 Subject: [PATCH] add exception if logfile not witreable --- Common/Logger.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Common/Logger.cpp b/Common/Logger.cpp index 6aa789b..3e3b8c9 100644 --- a/Common/Logger.cpp +++ b/Common/Logger.cpp @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include + #include "Logger.h" CLogger::CLogger(const wxString& directory, const wxString& name) : @@ -43,6 +45,8 @@ m_day(0) bool ret = m_file->Open(m_fileName.GetFullPath(), wxT("a+t")); if (!ret) { wxLogError(wxT("Cannot open %s file for appending"), m_fileName.GetFullPath().c_str()); + delete m_file; + throw std::runtime_error("Cannot open log file"); return; } }