mirror of https://github.com/Icinga/icinga2.git
parent
d713a6c940
commit
e0be9cd743
|
@ -42,7 +42,13 @@ Value::operator double(void) const
|
||||||
if (IsEmpty())
|
if (IsEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return boost::lexical_cast<double>(m_Value);
|
try {
|
||||||
|
return boost::lexical_cast<double>(m_Value);
|
||||||
|
} catch (const std::exception&) {
|
||||||
|
std::ostringstream msgbuf;
|
||||||
|
msgbuf << "Can't convert '" << *this << "' to a floating point number.";
|
||||||
|
BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Value::operator String(void) const
|
Value::operator String(void) const
|
||||||
|
|
Loading…
Reference in New Issue