fix exit status: several executables reported success (0) on failure or vice versa
Build and Deploy Documentation / build-and-deploy (push) Successful in 23s

Two bug patterns fixed across src/*.cpp:

- musrfit, musrview, any2many, addRun, musrFT, musrt0: a local
  success/ok/isGood flag was tracked and an error printed, but the
  function fell through to an unconditional `return PMUSR_SUCCESS;`
  at the end instead of propagating the failure.
- msr2data, msr2msr: the success path returned a nonzero code (1)
  instead of 0.

Also propagate previously-ignored return codes to the process exit
status in dump_header (format-dispatch functions), musrRootValidation
(schema validation / consistency checks), and write_musrRoot_runHeader
(FillFolder failure).
This commit is contained in:
suter_a committed 2026-08-27 12:38:46 +02:00
1 parent b21b26d307
commit 32f2d3defa
11 files changed
+54 -13

No files matched your search

+3
View File
@@ -369,6 +369,7 @@ int main(int argc, char *argv[])
if (show_errMsgBox)
musrview_error_msg(errMsg.str());
ok = false;
result = PMUSR_MSR_RUN_ERROR;
break;
}
if (!musrCanvas->IsValid()) {
@@ -377,6 +378,7 @@ int main(int argc, char *argv[])
if (show_errMsgBox)
musrview_error_msg(errMsg.str());
ok = false;
result = PMUSR_MSR_RUN_ERROR;
delete musrCanvas;
break;
}
@@ -393,6 +395,7 @@ int main(int argc, char *argv[])
if (!musrCanvas->IsValid()) { // something went wrong
ok = false;
result = PMUSR_MSR_RUN_ERROR;
break;
}