File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed
Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -156,16 +156,24 @@ Series &Series::setBasePath(std::string const &bp)
156156
157157std::string Series::meshesPath () const
158158{
159- return getAttribute (" meshesPath" ).get <std::string>();
159+ auto res = meshesPaths ();
160+ if (res.empty ())
161+ {
162+ throw no_such_attribute_error (" meshesPath" );
163+ }
164+ /*
165+ * @todo: Verify that meshesPath has canonical form
166+ */
167+ return res.at (0 );
160168}
161169
162170std::vector<std::string> Series::meshesPaths () const
163171{
164- try
172+ if ( containsAttribute ( " meshesPath " ))
165173 {
166174 return getAttribute (" meshesPath" ).get <std::vector<std::string>>();
167175 }
168- catch (no_such_attribute_error const &)
176+ else
169177 {
170178 return {};
171179 }
@@ -211,16 +219,24 @@ Series &Series::setMeshesPath(std::vector<std::string> const &mp)
211219
212220std::string Series::particlesPath () const
213221{
214- return getAttribute (" particlesPath" ).get <std::string>();
222+ auto res = particlesPaths ();
223+ if (res.empty ())
224+ {
225+ throw no_such_attribute_error (" particlesPath" );
226+ }
227+ /*
228+ * @todo: Verify that particlesPath has canonical form
229+ */
230+ return res.at (0 );
215231}
216232
217233std::vector<std::string> Series::particlesPaths () const
218234{
219- try
235+ if ( containsAttribute ( " particlesPath " ))
220236 {
221237 return getAttribute (" particlesPath" ).get <std::vector<std::string>>();
222238 }
223- catch (no_such_attribute_error const &)
239+ else
224240 {
225241 return {};
226242 }
You can’t perform that action at this time.
0 commit comments