1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fpga: fpga::createCards not finding a config is not an error

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
Niklas Eiling 2024-03-01 14:08:26 +01:00 committed by Niklas Eiling
parent f9ed272456
commit ce59e3183d

View file

@ -262,8 +262,8 @@ int fpga::createCards(json_t *config,
json_t *fpgas = json_object_get(config, "fpgas");
if (fpgas == nullptr) {
logger->error("No section 'fpgas' found in config");
exit(1);
logger->info("No section 'fpgas' found in config");
return 0;
}
const char *card_name;
@ -319,9 +319,11 @@ std::shared_ptr<fpga::Card> fpga::setupFpgaCard(const std::string &configFile,
// Deallocate JSON config
json_decref(json);
if (!card)
if (!card) {
throw RuntimeError("FPGA card {} not found in config or not working",
fpgaName);
}
return card;
}