From 7bfc7e357b29e22fd4bd0781a88ec9df3c01c49d Mon Sep 17 00:00:00 2001 From: Tom Perkins <thomas.perkins@stfc.ac.uk> Date: Fri, 13 Nov 2015 13:50:52 +0000 Subject: [PATCH] Re #13616 More descriptive error message when properties fail to load On attempting a sequential fit, if the properties cannot be loaded, a possible cause is that they have been cleared by changing the instrument. Tell the user this, show them what the original error was and display the error in the log too. --- MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp index 0c430a5cf4e..28aa50654a7 100644 --- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp +++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp @@ -3124,6 +3124,16 @@ void MuonAnalysis::openSequentialFitDialog() { loadAlg = createLoadAlgorithm(); } + catch (const std::runtime_error &err) { + QString message("Error while setting load properties.\n" + "If instrument was changed, properties will have been " + "cleared and should be reset.\n\n" + "Error was: "); + message.append(err.what()); + QMessageBox::critical(this, "Unable to open dialog", message); + g_log.error(message.ascii()); + return; + } catch(...) { QMessageBox::critical(this, "Unable to open dialog", "Error while setting load properties"); -- GitLab