diff --git a/src/slic3r/Utils/Http.cpp b/src/slic3r/Utils/Http.cpp index 79c4ecfa9..69301547c 100644 --- a/src/slic3r/Utils/Http.cpp +++ b/src/slic3r/Utils/Http.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -165,7 +166,7 @@ size_t Http::priv::form_file_read_cb(char *buffer, size_t size, size_t nitems, v try { stream->read(buffer, size * nitems); - } catch (...) { + } catch (const std::exception &) { return CURL_READFUNC_ABORT; } diff --git a/src/slic3r/Utils/OctoPrint.cpp b/src/slic3r/Utils/OctoPrint.cpp index cafa69c55..09ca02071 100644 --- a/src/slic3r/Utils/OctoPrint.cpp +++ b/src/slic3r/Utils/OctoPrint.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -69,7 +70,7 @@ bool OctoPrint::test(wxString &msg) const msg = wxString::Format(_(L("Mismatched type of print host: %s")), text ? *text : "OctoPrint"); } } - catch (...) { + catch (const std::exception &) { res = false; msg = "Could not parse server response"; } diff --git a/src/slic3r/Utils/PrintHost.cpp b/src/slic3r/Utils/PrintHost.cpp index e9e39e695..ab52b2344 100644 --- a/src/slic3r/Utils/PrintHost.cpp +++ b/src/slic3r/Utils/PrintHost.cpp @@ -170,8 +170,6 @@ void PrintHostJobQueue::priv::bg_thread_main() } } catch (const std::exception &e) { emit_error(e.what()); - } catch (...) { - emit_error("Unknown exception"); } // Cleanup leftover files, if any diff --git a/src/slic3r/Utils/Serial.cpp b/src/slic3r/Utils/Serial.cpp index acfd5fafd..594464692 100644 --- a/src/slic3r/Utils/Serial.cpp +++ b/src/slic3r/Utils/Serial.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -71,13 +72,10 @@ void parse_hardware_id(const std::string &hardware_id, SerialPortInfo &spi) std::regex pattern("USB\\\\.*VID_([[:xdigit:]]+)&PID_([[:xdigit:]]+).*"); std::smatch matches; if (std::regex_match(hardware_id, matches, pattern)) { - try { - vid = std::stoul(matches[1].str(), 0, 16); - pid = std::stoul(matches[2].str(), 0, 16); - spi.id_vendor = vid; - spi.id_product = pid; - } - catch (...) {} + vid = std::stoul(matches[1].str(), 0, 16); + pid = std::stoul(matches[2].str(), 0, 16); + spi.id_vendor = vid; + spi.id_product = pid; } } #endif