Catch exceptions by reference instead of by value (silence warning)

This commit is contained in:
Joseph Lenox 2021-04-03 11:44:53 -05:00
parent 8e6324954c
commit 1433ba65c9

View File

@ -369,7 +369,7 @@ void MainFrame::update_layout()
try { try {
icon_size = atoi(wxGetApp().app_config->get("tab_icon_size").c_str()); icon_size = atoi(wxGetApp().app_config->get("tab_icon_size").c_str());
} }
catch (std::exception e) {} catch (const std::exception& e) {}
if(icon_size >= 8) if(icon_size >= 8)
for (std::string icon_name : {"editor_menu", "layers", "preview_menu", "cog"}) { for (std::string icon_name : {"editor_menu", "layers", "preview_menu", "cog"}) {
const wxBitmap& bmp = create_scaled_bitmap(icon_name, this, icon_size); const wxBitmap& bmp = create_scaled_bitmap(icon_name, this, icon_size);
@ -1659,7 +1659,7 @@ bool MainFrame::load_config_file(const std::string &path)
{ {
try { try {
wxGetApp().preset_bundle->load_config_file(path); wxGetApp().preset_bundle->load_config_file(path);
} catch (const std::exception &ex) { } catch (const std::exception& ex) {
show_error(this, ex.what()); show_error(this, ex.what());
return false; return false;
} }
@ -1690,7 +1690,7 @@ void MainFrame::export_configbundle(bool export_physical_printers /*= false*/)
wxGetApp().app_config->update_config_dir(get_dir_name(file)); wxGetApp().app_config->update_config_dir(get_dir_name(file));
try { try {
wxGetApp().preset_bundle->export_configbundle(file.ToUTF8().data(), false, export_physical_printers); wxGetApp().preset_bundle->export_configbundle(file.ToUTF8().data(), false, export_physical_printers);
} catch (const std::exception &ex) { } catch (const std::exception& ex) {
show_error(this, ex.what()); show_error(this, ex.what());
} }
} }