diff --git a/src/silo_api/api.cpp b/src/silo_api/api.cpp index 17c51b027..52a4935c4 100644 --- a/src/silo_api/api.cpp +++ b/src/silo_api/api.cpp @@ -29,6 +29,7 @@ #include "silo/config/util/abstract_config_source.h" #include "silo/config/util/config_repository.h" #include "silo/config/util/yaml_file.h" +#include "silo/preprocessing/preprocessing_exception.h" #include "silo/preprocessing/preprocessor.h" #include "silo/preprocessing/sql_function.h" #include "silo/storage/reference_genomes.h" @@ -270,27 +271,12 @@ class SiloServer : public Poco::Util::ServerApplication { int handlePreprocessing() { SPDLOG_INFO("Starting SILO preprocessing"); - try { - const auto preprocessing_config = preprocessingConfig(config()); - - auto database = runPreprocessor(preprocessing_config); - - database.saveDatabaseState(preprocessing_config.getOutputDirectory()); - } catch (const std::exception& ex) { - SPDLOG_ERROR(ex.what()); - throw ex; - } catch (const std::string& ex) { - SPDLOG_ERROR(ex); - return 1; - } catch (...) { - SPDLOG_ERROR("Preprocessing cancelled with uncatchable (...) exception"); - const auto exception = std::current_exception(); - if (exception) { - const auto* message = abi::__cxa_current_exception_type()->name(); - SPDLOG_ERROR("current_exception: {}", message); - } - return 1; - } + const auto preprocessing_config = preprocessingConfig(config()); + + auto database = runPreprocessor(preprocessing_config); + + database.saveDatabaseState(preprocessing_config.getOutputDirectory()); + return Application::EXIT_OK; }