Skip to content

Commit

Permalink
Always report std::system_error
Browse files Browse the repository at this point in the history
On a release build, use wxMessageDialog.
  • Loading branch information
Randalphwa committed Jul 28, 2024
1 parent 00057a9 commit fbd8d59
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/generate/gen_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,12 @@ void BaseCodeGenerator::GenerateCppClass(PANEL_PAGE panel_type)
}
catch (const std::system_error& err)
{
#if defined(_DEBUG)
MSG_ERROR(err.what());
#else
wxMessageDialog dlg_error(nullptr, wxString::FromUTF8(err.what()), "Internal Thread Error", wxICON_ERROR | wxOK);
dlg_error.ShowModal();
#endif // _DEBUG
}

if (m_embedded_images.size())
Expand Down
10 changes: 10 additions & 0 deletions src/generate/gen_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,12 @@ void BaseCodeGenerator::GeneratePythonClass(PANEL_PAGE panel_type)
}
catch (const std::system_error& err)
{
#if defined(_DEBUG)
MSG_ERROR(err.what());
#else
wxMessageDialog dlg_error(nullptr, wxString::FromUTF8(err.what()), "Internal Thread Error", wxICON_ERROR | wxOK);
dlg_error.ShowModal();
#endif // _DEBUG
}

GeneratePythonImagesForm();
Expand Down Expand Up @@ -376,7 +381,12 @@ void BaseCodeGenerator::GeneratePythonClass(PANEL_PAGE panel_type)
}
catch (const std::system_error& err)
{
#if defined(_DEBUG)
MSG_ERROR(err.what());
#else
wxMessageDialog dlg_error(nullptr, wxString::FromUTF8(err.what()), "Internal Thread Error", wxICON_ERROR | wxOK);
dlg_error.ShowModal();
#endif // _DEBUG
}

if (m_embedded_images.size())
Expand Down
10 changes: 10 additions & 0 deletions src/generate/gen_ruby.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,12 @@ void BaseCodeGenerator::GenerateRubyClass(PANEL_PAGE panel_type)
}
catch (const std::system_error& err)
{
#if defined(_DEBUG)
MSG_ERROR(err.what());
#else
wxMessageDialog dlg_error(nullptr, wxString::FromUTF8(err.what()), "Internal Thread Error", wxICON_ERROR | wxOK);
dlg_error.ShowModal();
#endif // _DEBUG
}

thrd_need_img_func.join();
Expand Down Expand Up @@ -461,7 +466,12 @@ void BaseCodeGenerator::GenerateRubyClass(PANEL_PAGE panel_type)
}
catch (const std::system_error& err)
{
#if defined(_DEBUG)
MSG_ERROR(err.what());
#else
wxMessageDialog dlg_error(nullptr, wxString::FromUTF8(err.what()), "Internal Thread Error", wxICON_ERROR | wxOK);
dlg_error.ShowModal();
#endif // _DEBUG
}

if (m_embedded_images.size())
Expand Down

0 comments on commit fbd8d59

Please # to comment.