Skip to content
Snippets Groups Projects
Commit 09ca2901 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[AppL] isConvertible should not throw but return

Returning false when conversion would fail instead of
OGS_FATAL. The OGS_FATAL happens on the caller side.
parent e2233fc5
No related branches found
No related tags found
No related merge requests found
......@@ -39,19 +39,21 @@ bool isConvertibleToDouble(std::string const& s)
}
catch (...)
{
OGS_FATAL("The given string '{:s}' is not convertible to double.", s);
ERR("The given string '{:s}' is not convertible to double.", s);
return false;
}
if (pos != s.size())
{
OGS_FATAL(
"Only {:d} characters were used for double conversion of string "
ERR("Only {:d} characters were used for double conversion of string "
"'{:s}'",
pos, s);
return false;
}
if (std::isnan(value))
{
OGS_FATAL("The given string '{:s}' results in a NaN value.", s);
ERR("The given string '{:s}' results in a NaN value.", s);
return false;
}
return true;
}
......
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