mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 18:11:01 -05:00
Provide error if output failed in exoplanet data prep task
And update hardcoded filepath to teff_bv file to current version, for easier usage next time
This commit is contained in:
@@ -99,6 +99,22 @@ void ExoplanetsDataPreparationTask::perform(
|
||||
std::ofstream binFile(_outputBinPath, std::ios::out | std::ios::binary);
|
||||
std::ofstream lutFile(_outputLutPath);
|
||||
|
||||
if (!binFile.good()) {
|
||||
LERROR(fmt::format("Error when writing to {}",_outputBinPath));
|
||||
if (!std::filesystem::is_directory(_outputBinPath.parent_path())) {
|
||||
LERROR("Output directory does not exist");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!lutFile.good()) {
|
||||
LERROR(fmt::format("Error when writing to {}", _outputLutPath));
|
||||
if (!std::filesystem::is_directory(_outputLutPath.parent_path())) {
|
||||
LERROR("Output directory does not exist");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int version = 1;
|
||||
binFile.write(reinterpret_cast<char*>(&version), sizeof(int));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user