Skip to content

Commit

Permalink
Improve error handling when loading FMU
Browse files Browse the repository at this point in the history
  • Loading branch information
nl78 committed Feb 5, 2025
1 parent 8651460 commit 1465714
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions container/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ static int read_conf_fmu(container_t *container, const char *dirname, config_fil

logger(fmi2OK, "Loading '%s.dll' from directory '%s'", identifier, directory);

if (fmu_load_from_directory(container, i, directory, identifier, guid)) {
logger(fmi2Error, "Cannot load from directory '%s'", directory);
int status = fmu_load_from_directory(container, i, directory, identifier, guid);
if (status) {
logger(fmi2Error, "Cannot load from directory '%s' (status=%d)", directory, status);
free(identifier);
free(container->fmu);
container->fmu = NULL; /* to allow freeInstance on container */
return -4;
}

Expand Down

0 comments on commit 1465714

Please sign in to comment.