Fixed exceptionhandling

This commit is contained in:
Guilhem Lavaux 2011-06-06 10:18:25 -04:00
parent b1ad1930e6
commit ed2d0c7841

View File

@ -26,12 +26,16 @@ SimuData *CosmoTool::loadFlashMulti(const char *fname, int id, int loadflags)
const double kpc2cm = 3.08568025e21;
const double km2cm = 1.e5;
if (id != 0)
throw NoSuchFileException();
data = new SimuData;
if (data == 0) {
return 0;
}
filename = fname;
try {
H5File file (filename, H5F_ACC_RDONLY);
// simulation info
@ -79,6 +83,9 @@ SimuData *CosmoTool::loadFlashMulti(const char *fname, int id, int loadflags)
}
file.close();
} catch (const FileIException& e) {
throw NoSuchFileException();
}
return data;
}