Catch boost bad_numeric_cast exception and let parser return an error

This commit is contained in:
Patrick Niklaus
2016-10-10 17:20:29 +02:00
committed by Patrick Niklaus
parent 14b024e4dc
commit 240a7696da
3 changed files with 28 additions and 19 deletions
+5
View File
@@ -55,6 +55,11 @@ boost::optional<ParameterT> parseParameters(std::string::iterator &iter,
// iterator to the failing position. Extract the position from the exception ourselves.
iter = failure.first;
}
catch (const boost::numeric::bad_numeric_cast &e)
{
// this can happen if we get bad numeric values in the request, just handle
// as normal parser error
}
return boost::none;
}