Don't duplicate dbLoadRecords() error message

This commit is contained in:
Andrew Johnson
2025-10-08 16:10:00 -05:00
parent aba6309604
commit 9af7ff3b3f
2 changed files with 6 additions and 7 deletions

View File

@@ -805,7 +805,7 @@ int dbLoadRecords(const char* file, const char* subs)
if(dbLoadRecordsHook)
dbLoadRecordsHook(file, subs);
} else {
fprintf(stderr, ERL_ERROR " failed to load '%s'\n", file);
fprintf(stderr, ERL_ERROR ": Failed to load '%s'\n", file);
if(status==-2)
fprintf(stderr, " Records cannot be loaded after iocInit!\n");
}

View File

@@ -185,7 +185,7 @@ int main(int argc, char *argv[])
break;
case 'D':
if(lazy_dbd_loaded) {
throw std::runtime_error("-D specified too late. softIoc.dbd already loaded.\n");
throw std::runtime_error("-D specified too late, softIoc.dbd already loaded.\n");
}
dbd_file = optarg;
break;
@@ -195,8 +195,7 @@ int main(int argc, char *argv[])
+ optarg + "\"" + ( !macros.empty() ?
(std::string(", \"") + macros + "\"") : std::string() )
+ ")");
errIf(dbLoadRecords(optarg, macros.c_str()),
std::string("Failed to load: ")+optarg);
errIf(dbLoadRecords(optarg, macros.c_str()), "");
loadedDb = true;
break;
case 'm':
@@ -216,8 +215,7 @@ int main(int argc, char *argv[])
xmacro += optarg;
verbose_out(CMD, std::string("dbLoadRecords(\"")
+ exit_file + "\", \"" + xmacro + "\")");
errIf(dbLoadRecords(exit_file.c_str(), xmacro.c_str()),
std::string("Failed to load: ")+exit_file);
errIf(dbLoadRecords(exit_file.c_str(), xmacro.c_str()), "");
loadedDb = true;
break;
}
@@ -274,7 +272,8 @@ int main(int argc, char *argv[])
}catch(std::exception& e){
errlogFlush();
std::cerr<<ERL_ERROR ": "<<e.what()<<"\n";
if (e.what()[0] != '\0')
std::cerr<<ERL_ERROR ": "<<e.what()<<"\n";
epicsExit(2);
return 2;
}