Skip to content

Commit

Permalink
Make throwErrorMessage generic via templates. Refs #8538.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed Apr 8, 2014
1 parent 81fabd7 commit e228227
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Expand Up @@ -73,8 +73,6 @@ namespace Mantid
virtual const std::string registerDatafileDOI(const long long& databaseID);

private:
// Ensures human friendly error messages are provided to the user.
void throwErrorMessage(ICat4::ICATPortBindingProxy& icat);
// Saves "MyData" query result to output workspace.
void saveInvestigations(std::vector<ICat4::xsd__anyType*> response, API::ITableWorkspace_sptr& outputws);
// Creates a search query string based on inputs provided by the user.
Expand All @@ -95,6 +93,10 @@ namespace Mantid
// Stores the session details for a specific catalog.
API::CatalogSession_sptr m_session;

// Ensures human friendly error messages are provided to the user.
template<class T>
void throwErrorMessage(T& soapProxy);

// Defines the SSL authentication scheme.
template<class T>
void setSSLContext(T& soapProxy);
Expand Down
7 changes: 4 additions & 3 deletions Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp
Expand Up @@ -871,13 +871,14 @@ namespace Mantid

/**
* Throws an error message (returned by gsoap) to Mantid upper layer.
* @param icat :: ICATPortBindingProxy object.
* @param soapProxy :: The PortBindingProxy object.
*/
void ICat4Catalog::throwErrorMessage(ICat4::ICATPortBindingProxy& icat)
template<class T>
void ICat4Catalog::throwErrorMessage(T& soapProxy)
{
char buf[600];
const int len = 600;
icat.soap_sprint_fault(buf,len);
soapProxy.soap_sprint_fault(buf,len);
std::string error(buf);
std::string begmsg("<message>");
std::string endmsg("</message>");
Expand Down

0 comments on commit e228227

Please sign in to comment.