Skip to content
Snippets Groups Projects
Commit e483240d authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler Committed by Tobias Leibner
Browse files

[string_internal] catch stl exception in convert_from_string()

parent 63b6992d
No related branches found
No related tags found
No related merge requests found
......@@ -114,7 +114,12 @@ struct Helper<bool, anything>
{ \
static inline tn convert_from_string(std::string ss) \
{ \
return std::sto##tns(ss); \
try { \
return std::sto##tns(ss); \
} catch (const std::exception& ee) { \
DUNE_THROW(Exceptions::conversion_error, \
"in stl when converting '" << ss << "' to '" << Typename<tn>::value() << "': " << ee.what()); \
} \
} \
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment