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 kpc2cm = 3.08568025e21;
|
||||||
const double km2cm = 1.e5;
|
const double km2cm = 1.e5;
|
||||||
|
|
||||||
|
if (id != 0)
|
||||||
|
throw NoSuchFileException();
|
||||||
|
|
||||||
data = new SimuData;
|
data = new SimuData;
|
||||||
if (data == 0) {
|
if (data == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = fname;
|
filename = fname;
|
||||||
|
try {
|
||||||
H5File file (filename, H5F_ACC_RDONLY);
|
H5File file (filename, H5F_ACC_RDONLY);
|
||||||
|
|
||||||
// simulation info
|
// simulation info
|
||||||
@ -79,6 +83,9 @@ SimuData *CosmoTool::loadFlashMulti(const char *fname, int id, int loadflags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
} catch (const FileIException& e) {
|
||||||
|
throw NoSuchFileException();
|
||||||
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user