From 4f19b94c2827d2b5d582e6faf6f0221bb6bc11d1 Mon Sep 17 00:00:00 2001 From: Jay Rainey Date: Fri, 25 Apr 2014 12:09:44 +0100 Subject: [PATCH] Obtain specific error message from soap method instead. Refs #8538. --- .../Framework/ICat/src/ICat4/ICat4Catalog.cpp | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp b/Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp index cdb9829110dc..a3b949b999e9 100644 --- a/Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp +++ b/Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp @@ -946,25 +946,10 @@ namespace Mantid template void ICat4Catalog::throwSoapError(T& soapProxy) { - char buf[600]; - const int len = 600; - soapProxy.soap_sprint_fault(buf,len); - std::string error(buf); - std::string begmsg(""); - std::string endmsg(""); - - std::basic_string ::size_type start = error.find(begmsg); - std::basic_string ::size_type end = error.find(endmsg); - std::string exception; - - if(start != std::string::npos && end != std::string::npos) - { - exception = error.substr(start + begmsg.length(), end - (start + begmsg.length()) ); - } + std::string error = soapProxy.soap_fault_string(); // If no error is returned by ICAT then there is a connection problem. - if (exception.empty()) exception = "ICAT appears to be offline. Please check your connection or report this issue."; - - throw std::runtime_error(exception); + if (error.empty()) error = "ICAT appears to be offline. Please check your connection or report this issue."; + throw std::runtime_error(error); } /**