Skip to content

Commit

Permalink
Handle errors returned by the IDS. Refs #7636.
Browse files Browse the repository at this point in the history
- It's not possible to throw a runtime_error as poco catches it, then throws another I/O error instead! This is related to a bug in POCO 1.4 (http://sourceforge.net/p/poco/bugs/403/). Instead, I have logged the message and informed the user of the possible problems.
- This "error handling" will be improved on the GUI, but needs to exist as is for when user's write scripts against this algorithm.
  • Loading branch information
jawrainey committed Jan 9, 2014
1 parent 6be9870 commit 277579a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Code/Mantid/Framework/ICat/src/CatalogPublish.cpp
Expand Up @@ -124,6 +124,14 @@ namespace Mantid
// Close the request by requesting a response.
Poco::Net::HTTPResponse response;
session.receiveResponse(response);

// Throw an error if the server encounters an internal error.
// (Note: The IDS does not currently return any meta-data related to the errors caused.)
if (response.getStatus() == 500)
{
g_log.error("An error has occurred on the ICAT IDS server.\n"
"Perhaps the file name already exists, or you have provided an invalid investigation ID.");
}
}
catch(Poco::Net::SSLException& error)
{
Expand Down

0 comments on commit 277579a

Please sign in to comment.