aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@0994f19a-7e1f-4f5a-9787-1e7a3bb7f33f>2012-01-26 17:04:26 +0000
committerrhaas <rhaas@0994f19a-7e1f-4f5a-9787-1e7a3bb7f33f>2012-01-26 17:04:26 +0000
commitadbdad578fe3592658055ca60f065001ca1615fa (patch)
treefa273a3fd2076d87b38179c57f1cb793802ec63f
parentfc3248a93a8e59bd363db602feea537398b659b8 (diff)
catch ios::failure exception from Bin_NS and transfer to CCTK_WarnHEADsvnmaster
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/Meudon_Bin_BH/trunk@13 0994f19a-7e1f-4f5a-9787-1e7a3bb7f33f
-rw-r--r--src/Bin_BH.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Bin_BH.cc b/src/Bin_BH.cc
index e501a38..c31c0cc 100644
--- a/src/Bin_BH.cc
+++ b/src/Bin_BH.cc
@@ -2,6 +2,7 @@
#include <cmath>
#include <cstdio>
#include <vector>
+#include <ios>
#include <cctk.h>
#include <cctk_Arguments.h>
@@ -63,6 +64,7 @@ void ID_Bin_BH_initialise (CCTK_ARGUMENTS)
CCTK_VInfo (CCTK_THORNSTRING, "Reading from file \"%s\"", filename);
+ try {
Bin_BH bin_bh (npoints, &xx[0], &yy[0], &zz[0], 1, filename);
CCTK_VInfo (CCTK_THORNSTRING, "Omega [1/a]: %g", bin_bh.omega);
@@ -165,4 +167,8 @@ void ID_Bin_BH_initialise (CCTK_ARGUMENTS)
CCTK_INFO ("Done.");
+ } catch (ios::failure e) {
+ CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Could not read initial data from file '%s': %s", filename, e.what());
+ }
}