Skip to content

Commit

Permalink
Display ICAT error on GUI. Refs #9208.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed Mar 28, 2014
1 parent 2dd4d5c commit ce2437c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp
Expand Up @@ -58,7 +58,22 @@ namespace MantidQt

// This again is a temporary measure to ensure publishing functionality will work with one catalog.
auto session = Mantid::API::CatalogManager::Instance().getActiveSessions();
if (!session.empty()) Mantid::API::CatalogManager::Instance().getCatalog(session.front()->getSessionId())->myData(workspace);

// We need to catch the exception to prevent a fatal error.
try
{
if (!session.empty())
{
Mantid::API::CatalogManager::Instance().getCatalog(session.front()->getSessionId())->myData(workspace);
}
}
catch(std::runtime_error& e)
{
setOptionalMessage(e.what());
m_uiForm.scrollArea->setDisabled(true);
m_uiForm.runBtn->setDisabled(true);
return;
}

// The user is not an investigator on any investigations and cannot publish
// or they are not logged into the catalog then update the related message..
Expand Down

0 comments on commit ce2437c

Please sign in to comment.