Skip to content

Commit

Permalink
loader.cpp: Catch std::exception instead of std::runtime_error
Browse files Browse the repository at this point in the history
Also, catch const reference instead of non-const reference
  • Loading branch information
Hermann von Kleist committed Jan 13, 2020
1 parent ce43b48 commit 657c8e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nodelet/src/loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
Expand All @@ -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
Expand Down

0 comments on commit 657c8e7

Please sign in to comment.