mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-08 22:34:30 +02:00
parent
d713a6c940
commit
e0be9cd743
@ -42,7 +42,13 @@ Value::operator double(void) const
|
|||||||
if (IsEmpty())
|
if (IsEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
try {
|
||||||
return boost::lexical_cast<double>(m_Value);
|
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…
x
Reference in New Issue
Block a user