Skip to content
Snippets Groups Projects
Commit eb10299d authored by Sonia Minolli's avatar Sonia Minolli
Browse files

Change Nexus exception handling (TANGODEVIC-1473)

parent 81f378a4
No related branches found
No related tags found
No related merge requests found
......@@ -55,12 +55,13 @@ NexusManager::~NexusManager ()
}
catch (nxcpp::NexusException &n)
{
ERROR_STREAM << "Nexus4TangoException caught ..." << std::endl;
n.dump();
ERROR_STREAM << "Nexus4TangoException caught: "
<< n.to_string()
<< std::endl;
}
catch(...)
{
ERROR_STREAM << "NexusManager::~NexusManager caught [...] : " << std::endl;
ERROR_STREAM << "NexusManager::~NexusManager caught [...]!" << std::endl;
}
}
......@@ -124,10 +125,14 @@ void NexusManager::initNexusAcquisition(std::string nexus_file_path,
}
catch(nxcpp::NexusException &n)
{
ERROR_STREAM << "NexusManager::initNexusAcquisition -> caught Nexus4TangoException." << std::endl;
this->manageNexusAbort();
ERROR_STREAM << "Nexus4TangoException caught ... see log." << std::endl;
n.dump();
ERROR_STREAM << "NexusManager::initNexusAcquisition -> caught Nexus4TangoException: "
<< n.to_string()
<< std::endl;
if (m_pAcqWriter)
m_pAcqWriter->Abort();
ERROR_STREAM << "Nexus storage ABORTED." << std::endl;
Tango::DevFailed df = this->nexusToTangoException(n);
throw df;
}
......@@ -199,8 +204,10 @@ void NexusManager::initNexusAcquisition(std::string nexus_file_path,
}
catch(nxcpp::NexusException &n4te)
{
ERROR_STREAM << "NexusManager::initNexusAcquisition -> caught NEXUS Exception : see logs" << std::endl;
n4te.dump();
ERROR_STREAM << "NexusManager::initNexusAcquisition -> caught NEXUS Exception: "
<< n4te.to_string()
<< std::endl;
Tango::DevFailed df = this->nexusToTangoException(n4te);
throw df;
}
......@@ -267,25 +274,33 @@ void NexusManager::finalizeNexusGeneration()
}
catch(nxcpp::NexusException &n)
{
ERROR_STREAM << "NexusManager::finalizeNxGeneration -> Nexus4TangoException caught." << std::endl;
n.dump();
this->manageNexusAbort();
ERROR_STREAM << "NexusManager::finalizeNxGeneration -> Nexus4TangoException caught: "
<< n.to_string()
<< std::endl;
if (m_pAcqWriter)
m_pAcqWriter->Abort();
ERROR_STREAM << "Nexus storage ABORTED." << std::endl;
Tango::DevFailed df = this->nexusToTangoException(n);
throw df;
}
catch(yat::Exception &n)
{
ERROR_STREAM << "NexusManager::finalizeNxGeneration -> yat::Exception caught." << std::endl;
n.dump();
ERROR_STREAM << "NexusManager::finalizeNxGeneration -> yat::Exception caught: "
<< n.to_string()
<< std::endl;
if (m_pAcqWriter)
m_pAcqWriter->Abort();
ERROR_STREAM << "Nexus storage ABORTED." << std::endl;
this->manageNexusAbort();
}
catch(...)
{
ERROR_STREAM << "NexusManager::finalizeNxGeneration -> caught [...] Exception" << std::endl;
ERROR_STREAM << "Nexus stotage ABORTED." << std::endl;
this->manageNexusAbort();
ERROR_STREAM << "Nexus stotage ABORTED." << std::endl;
THROW_DEVFAILED(_CPTC("DEVICE_ERROR"),
_CPTC("Failed to finilize Nexus storage (caught [...])!"),
_CPTC("NexusManager::finalizeNxGeneration"));
......
......@@ -152,10 +152,14 @@ public:
}
catch(nxcpp::NexusException &n)
{
ERROR_STREAM << "NexusManager::pushNexusData -> caught NEXUS Exception" << std::endl;
n.dump();
ERROR_STREAM << "NexusManager::pushNexusData -> caught NEXUS Exception:"
<< n.to_string()
<< std::endl;
this->m_storageError = true;
this->manageNexusAbort();
if (m_pAcqWriter)
m_pAcqWriter->Abort();
Tango::DevFailed df = this->nexusToTangoException(n);
throw df;
}
......@@ -205,9 +209,10 @@ public:
// from nxcpp::IExceptionHandler
void OnNexusException(const nxcpp::NexusException &e)
{
ERROR_STREAM << "NexusManager::OnNexusException -> caught NEXUS Exception" << std::endl;
e.dump();
this->manageNexusAbort();
ERROR_STREAM << "NexusManager::OnNexusException -> caught NEXUS Exception:"
<< e.to_string()
<< std::endl;
this->m_pAcqWriter->Abort();
this->m_storageError = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment