summaryrefslogtreecommitdiff
path: root/project2/common/variableConvert.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/common/variableConvert.cpp')
-rw-r--r--project2/common/variableConvert.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/project2/common/variableConvert.cpp b/project2/common/variableConvert.cpp
index 7eb16cf..a7ddca4 100644
--- a/project2/common/variableConvert.cpp
+++ b/project2/common/variableConvert.cpp
@@ -28,7 +28,7 @@ set(const VariableType * var, const T * t)
return ::set(var, t, deleter<T>);
}
-SimpleMessageException(InvalidConversionTo);
+SimpleMessage2Exception(InvalidConversionTo);
class NullVariable : std::runtime_error {
public:
@@ -131,7 +131,7 @@ class ConvertVisitor : public boost::static_visitor<DestType> {
return boost::lexical_cast<DestType>(r);
}
DestType operator()(const boost::posix_time::ptime &) const {
- throw InvalidConversionTo(typeid(DestType).name());
+ throw InvalidConversionTo(typeid(DestType).name(), "<Date Time>");
}
DestType operator()(const Null &) const {
throw NullVariable();
@@ -162,7 +162,7 @@ class ConvertVisitorDateTime : public boost::static_visitor<const boost::posix_t
}
template <typename T>
const boost::posix_time::ptime & operator()(const T &) const {
- throw InvalidConversionTo("DateTime");
+ throw InvalidConversionTo("DateTime", typeid(T).name());
}
private:
const VariableType * var;
@@ -176,10 +176,10 @@ class ConvertVisitorBool : public boost::static_visitor<bool> {
const char * str = s.c_str();
if (strcasecmp(str, "true") == 0 || strcasecmp(str, "yes") == 0 || strcasecmp(str, "on") == 0) return true;
if (strcasecmp(str, "false") == 0 || strcasecmp(str, "no") == 0 || strcasecmp(str, "off") == 0) return false;
- throw InvalidConversionTo("bool");
+ throw InvalidConversionTo("bool", s);
}
bool operator()(const boost::posix_time::ptime &) const {
- throw InvalidConversionTo("bool");
+ throw InvalidConversionTo("bool", "<Date time>");
}
bool operator()(const Null &) const {
throw NullVariable();