File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1169,7 +1169,17 @@ template<Base::LogStyle category,
11691169inline void
11701170Base::ConsoleSingleton::Send (const std::string& notifiername, const char * pMsg, Args&&... args)
11711171{
1172- std::string format = fmt::sprintf (pMsg, args...);
1172+ std::string format;
1173+ try {
1174+ format = fmt::sprintf (pMsg, args...);
1175+ }
1176+ catch (fmt::format_error& e) {
1177+ // We can't allow an exception to propagate out of this method, which gets used in some
1178+ // destructors. Instead, make the string's contents the error message that fmt::sprintf gave
1179+ // us.
1180+ format = std::string (" ERROR: Invalid format string or arguments provided.\n " );
1181+ format += e.what ();
1182+ }
11731183
11741184 if (connectionMode == Direct) {
11751185 Notify<category, recipient, contenttype>(notifiername, format);
Original file line number Diff line number Diff line change 2424
2525#ifndef _PreComp_
2626#include < boost/tokenizer.hpp>
27+ #include < boost/regex.hpp>
2728#include < deque>
2829#include < memory>
2930#include < sstream>
@@ -107,7 +108,7 @@ Sheet::~Sheet()
107108 try {
108109 clearAll ();
109110 }
110- catch (boost::wrapexcept<boost:: regex_error> &) {
111+ catch (boost::regex_error&) {
111112 // Don't let an exception propagate out of a destructor (calls terminate())
112113 Base::Console ().Error (
113114 " clearAll() resulted in an exception when deleting the spreadsheet : %s\n " ,
You can’t perform that action at this time.
0 commit comments