Skip to content

Commit

Permalink
[irods#5800] catch boost::bad_lexical_cast by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
SwooshyCueb authored and alanking committed Feb 4, 2025
1 parent 2a39f22 commit ef4e7f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/core/include/irods/irods_lexical_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ namespace irods {
error lexical_cast( S _s, T& _t ) {
try {
_t = boost::lexical_cast<T>(_s);
} catch( boost::bad_lexical_cast ) {
}
catch (const boost::bad_lexical_cast&) {
std::stringstream msg;
msg << "failed to cast " << _s;
return ERROR(
Expand All @@ -27,7 +28,8 @@ namespace irods {
error lexical_cast( T& _t, uint64_t _s ) {
try {
_t = boost::lexical_cast<T>(_s);
} catch( boost::bad_lexical_cast ) {
}
catch (const boost::bad_lexical_cast&) {
std::stringstream msg;
msg << "failed to cast " << _s;
return ERROR(
Expand All @@ -41,7 +43,8 @@ namespace irods {
error lexical_cast( T& _t, const std::string& _s ) {
try {
_t = boost::lexical_cast<T>(_s);
} catch( boost::bad_lexical_cast ) {
}
catch (const boost::bad_lexical_cast&) {
std::stringstream msg;
msg << "failed to cast " << _s;
return ERROR(
Expand Down

0 comments on commit ef4e7f8

Please sign in to comment.