Skip to content
Snippets Groups Projects
Commit 1bd08a12 authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

better exception message in visitors

parent c4cca621
No related branches found
No related tags found
1 merge request!332Rename ARON numeric primitive typenames
......@@ -57,7 +57,17 @@ namespace armarx::aron::data
virtual void visitDouble(Input& element) {};
virtual void visitBool(Input& element) {};
virtual void visitString(Input& element) {};
virtual void visitUnknown(Input& element) { throw error::AronException(__PRETTY_FUNCTION__, "Unknown type in visitor."); }
virtual void visitUnknown(Input& element)
{
if (!element)
{
throw error::AronException(__PRETTY_FUNCTION__, "Unknown type in visitor. The element was NULL.");
}
else
{
throw error::AronException(__PRETTY_FUNCTION__, "Unknown type in visitor. The element was set but descriptor was undefined.");
}
}
virtual ~RecursiveVisitor() = default;
};
......@@ -108,8 +118,16 @@ namespace armarx::aron::data
virtual void visitBool(DataInput& elementData, TypeInput& elementType) {};
virtual void visitString(DataInput& elementData, TypeInput& elementType) {};
virtual void visitAnyObject(DataInput& elementData, TypeInput& elementType) {};
virtual void visitUnknown(DataInput& elementData, TypeInput& elementType) {
throw error::AronException(__PRETTY_FUNCTION__, "Unknown type in visitor.");
virtual void visitUnknown(DataInput& elementData, TypeInput& elementType)
{
if (!elementData)
{
throw error::AronException(__PRETTY_FUNCTION__, "Unknown type in visitor. The element was NULL.");
}
else
{
throw error::AronException(__PRETTY_FUNCTION__, "Unknown type in visitor. The element was set but descriptor was undefined.");
}
}
virtual ~RecursiveTypedVisitor() = default;
};
......
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