aboutsummaryrefslogtreecommitdiff
path: root/src/tafnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tafnode.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/tafnode.cpp b/src/tafnode.cpp
index 829a8e1..09fc21b 100644
--- a/src/tafnode.cpp
+++ b/src/tafnode.cpp
@@ -111,7 +111,13 @@ bool Bu::TafGroup::hasChild( const Bu::FString &sName ) const
111 111
112const Bu::TafGroup::GroupList &Bu::TafGroup::getChildren( const Bu::FString &sName ) const 112const Bu::TafGroup::GroupList &Bu::TafGroup::getChildren( const Bu::FString &sName ) const
113{ 113{
114 return hChildren.get( sName ); 114 try {
115 return hChildren.get( sName );
116 } catch( Bu::HashException &e )
117 {
118 throw Bu::TafException("No children of group \"%s\" match \"%s\".",
119 this->sName.getStr(), sName.getStr() );
120 }
115} 121}
116 122
117const Bu::TafGroup::NodeList &Bu::TafGroup::getChildren() const 123const Bu::TafGroup::NodeList &Bu::TafGroup::getChildren() const
@@ -121,7 +127,13 @@ const Bu::TafGroup::NodeList &Bu::TafGroup::getChildren() const
121 127
122const Bu::TafGroup *Bu::TafGroup::getChild( const Bu::FString &sName ) const 128const Bu::TafGroup *Bu::TafGroup::getChild( const Bu::FString &sName ) const
123{ 129{
124 return hChildren.get( sName ).first(); 130 try {
131 return hChildren.get( sName ).first();
132 } catch( Bu::HashException &e )
133 {
134 throw Bu::TafException("No children of group \"%s\" match \"%s\".",
135 this->sName.getStr(), sName.getStr() );
136 }
125} 137}
126 138
127bool Bu::TafGroup::hasProperty( const Bu::FString &sName ) const 139bool Bu::TafGroup::hasProperty( const Bu::FString &sName ) const
@@ -131,12 +143,24 @@ bool Bu::TafGroup::hasProperty( const Bu::FString &sName ) const
131 143
132const Bu::TafGroup::PropList &Bu::TafGroup::getProperties( const Bu::FString &sName ) const 144const Bu::TafGroup::PropList &Bu::TafGroup::getProperties( const Bu::FString &sName ) const
133{ 145{
134 return hProp.get( sName ); 146 try {
147 return hProp.get( sName );
148 } catch( Bu::HashException &e )
149 {
150 throw Bu::TafException("No properties of group \"%s\" match \"%s\".",
151 this->sName.getStr(), sName.getStr() );
152 }
135} 153}
136 154
137const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName ) const 155const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName ) const
138{ 156{
139 return hProp.get( sName ).first(); 157 try {
158 return hProp.get( sName ).first();
159 } catch( Bu::HashException &e )
160 {
161 throw Bu::TafException("No properties of group \"%s\" match \"%s\".",
162 this->sName.getStr(), sName.getStr() );
163 }
140} 164}
141 165
142const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName, 166const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName,