diff options
Diffstat (limited to 'src/tafnode.cpp')
-rw-r--r-- | src/tafnode.cpp | 32 |
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 | ||
112 | const Bu::TafGroup::GroupList &Bu::TafGroup::getChildren( const Bu::FString &sName ) const | 112 | const 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 | ||
117 | const Bu::TafGroup::NodeList &Bu::TafGroup::getChildren() const | 123 | const Bu::TafGroup::NodeList &Bu::TafGroup::getChildren() const |
@@ -121,7 +127,13 @@ const Bu::TafGroup::NodeList &Bu::TafGroup::getChildren() const | |||
121 | 127 | ||
122 | const Bu::TafGroup *Bu::TafGroup::getChild( const Bu::FString &sName ) const | 128 | const 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 | ||
127 | bool Bu::TafGroup::hasProperty( const Bu::FString &sName ) const | 139 | bool Bu::TafGroup::hasProperty( const Bu::FString &sName ) const |
@@ -131,12 +143,24 @@ bool Bu::TafGroup::hasProperty( const Bu::FString &sName ) const | |||
131 | 143 | ||
132 | const Bu::TafGroup::PropList &Bu::TafGroup::getProperties( const Bu::FString &sName ) const | 144 | const 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 | ||
137 | const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName ) const | 155 | const 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 | ||
142 | const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName, | 166 | const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName, |