Fixed exceptionhandling
This commit is contained in:
parent
b1ad1930e6
commit
ed2d0c7841
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user