Skip to content

Commit

Permalink
catch exceptions as const
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Williams <[email protected]>
Change-Id: I4447cb11880e36b44c8913e56c728ccd76d2044d
  • Loading branch information
williamspatrick committed Oct 6, 2021
1 parent a38f6e6 commit 97a709b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ std::string getBiosAttrStr(const std::filesystem::path& elementsJsonFilePath,
name = iter["element_name"].get<std::string>();
lid = iter["short_lid_name"].get<std::string>();
}
catch (std::exception& e)
catch (const std::exception& e)
{
// Possibly the element or lid name field was not found
log<level::ERR>("Error reading JSON field",
Expand Down
4 changes: 2 additions & 2 deletions ubi/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool restoreFromFile(const std::string& versionId, uint8_t& priority)
varArchive(cereal::make_nvp("priority", priority));
return true;
}
catch (cereal::RapidJSONException& e)
catch (const cereal::RapidJSONException& e)
{
std::filesystem::remove(varPath);
}
Expand All @@ -76,7 +76,7 @@ bool restoreFromFile(const std::string& versionId, uint8_t& priority)
rwArchive(cereal::make_nvp("priority", priority));
return true;
}
catch (cereal::RapidJSONException& e)
catch (const cereal::RapidJSONException& e)
{
std::filesystem::remove(rwPath);
}
Expand Down

0 comments on commit 97a709b

Please sign in to comment.