From 657c8e72dc7a5a7e2f337d1d6674055ad7525605 Mon Sep 17 00:00:00 2001 From: Hermann von Kleist Date: Mon, 13 Jan 2020 17:56:35 +0100 Subject: [PATCH] loader.cpp: Catch std::exception instead of std::runtime_error Also, catch const reference instead of non-const reference --- nodelet/src/loader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodelet/src/loader.cpp b/nodelet/src/loader.cpp index f0a34fc3..5bf01bfd 100644 --- a/nodelet/src/loader.cpp +++ b/nodelet/src/loader.cpp @@ -277,7 +277,7 @@ bool Loader::load(const std::string &name, const std::string& type, const ros::M { p = impl_->create_instance_(type); } - catch (std::runtime_error& e) + catch (const std::exception& e) { // If we cannot refresh the nodelet cache, fail immediately if(!impl_->refresh_classes_) @@ -292,7 +292,7 @@ bool Loader::load(const std::string &name, const std::string& type, const ros::M impl_->refresh_classes_(); p = impl_->create_instance_(type); } - catch (std::runtime_error& e2) + catch (const std::exception& e2) { // dlopen() can return inconsistent results currently (see // https://sourceware.org/bugzilla/show_bug.cgi?id=17833), so make sure