diff --git a/src/musrview.cpp b/src/musrview.cpp index 69385194..eddb1eab 100644 --- a/src/musrview.cpp +++ b/src/musrview.cpp @@ -297,7 +297,10 @@ int main(int argc, char *argv[]) success = dataHandler->IsAllDataAvailable(); if (!success) { - std::cerr << std::endl << ">> musrview **ERROR** Couldn't read all data files, will quit ..." << std::endl; + errMsg << ">> musrview **ERROR** Couldn't read all data files, will quit ...\n"; + std::cerr << errMsg.str(); + if (show_errMsgBox) + musrview_error_msg(errMsg.str()); result = PMUSR_DATA_FILE_READ_ERROR; } @@ -318,8 +321,11 @@ int main(int argc, char *argv[]) if (runPresent) { success = runListCollection->Add(i, kView); if (!success) { - std::cerr << std::endl << ">> musrview **ERROR** Couldn't handle run no " << i << " "; - std::cerr << (*msrHandler->GetMsrRunList())[i].GetRunName()->Data(); + errMsg << ">> musrview **ERROR** Couldn't handle run no " << i << " "; + errMsg << (*msrHandler->GetMsrRunList())[i].GetRunName()->Data() << "\n"; + std::cerr << errMsg.str(); + if (show_errMsgBox) + musrview_error_msg(errMsg.str()); result = PMUSR_MSR_RUN_ERROR; break; } @@ -359,8 +365,10 @@ int main(int argc, char *argv[]) fourier, avg, theoAtData); if (!musrCanvas->IsValid()) { - std::cerr << std::endl << ">> musrview **SEVERE ERROR** Couldn't invoke all necessary objects, will quit."; - std::cerr << std::endl; + errMsg << ">> musrview **SEVERE ERROR** Couldn't invoke all necessary objects, will quit.\n"; + std::cerr << errMsg.str(); + if (show_errMsgBox) + musrview_error_msg(errMsg.str()); ok = false; break; }