@@ -51,7 +51,7 @@ void CatchType()
5151
5252}
5353
54- bool CatchThrow (const std::function<void ()> &func,
54+ bool CatchThrow (const std::function<void ()> &func, const char *tag,
5555 bool print_backtrace, bool abort_process) noexcept
5656{
5757 try {
@@ -61,22 +61,22 @@ bool CatchThrow(const std::function<void()> &func,
6161
6262 } catch (const std::exception &e) {
6363 CatchType ();
64- LogWarn (" what(): %s" , e.what ());
64+ LogWarn (" '%s' what(): %s" , tag , e.what ());
6565 } catch (const char *e) {
6666 CatchType ();
67- LogWarn (" value: %s" , e);
67+ LogWarn (" '%s' value: %s" , tag , e);
6868 } catch (int e) {
6969 CatchType ();
70- LogWarn (" value: %d" , e);
70+ LogWarn (" '%s' value: %d" , tag , e);
7171 } catch (double e) {
7272 CatchType ();
73- LogWarn (" value: %f" , e);
73+ LogWarn (" '%s' value: %f" , tag , e);
7474 } catch (const std::string &e) {
7575 CatchType ();
76- LogWarn (" value: %s" , e.c_str ());
76+ LogWarn (" '%s' value: %s" , tag , e.c_str ());
7777 } catch (...) {
7878 CatchType ();
79- LogWarn (" can't print value" );
79+ LogWarn (" '%s' can't print value" , tag );
8080 }
8181
8282 if (print_backtrace) {
0 commit comments