Commit c9205e44 authored by Steven Murray's avatar Steven Murray
Browse files

Catalogue::PrepareToRetrieveXXXX() methods now throw UserError exceptions if...

Catalogue::PrepareToRetrieveXXXX() methods now throw UserError exceptions if the tapes involved are disabled.  The error message is now clearer: 'No tape files available for archive file with ...
parent 2384f179
......@@ -6474,7 +6474,7 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId_disa
m_catalogue->setTapeDisabled(m_admin, vid2, true);
ASSERT_THROW(m_catalogue->prepareToRetrieveFile(diskInstanceName1, archiveFileId, userIdentity, dummyLc),
exception::Exception);
exception::UserError);
}
TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingDiskFileId) {
......@@ -7037,7 +7037,7 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingDiskFileId_disable
m_catalogue->setTapeDisabled(m_admin, vid2, true);
ASSERT_THROW(m_catalogue->prepareToRetrieveFileByDiskFileId(diskInstanceName1, diskFileId, userIdentity, dummyLc),
exception::Exception);
exception::UserError);
}
TEST_P(cta_catalogue_CatalogueTest, getArchiveFiles_non_existance_archiveFileId) {
......
......@@ -4335,8 +4335,8 @@ common::dataStructures::RetrieveFileQueueCriteria RdbmsCatalogue::prepareToRetri
auto archiveFile = getArchiveFileToRetrieveByArchiveFileId(conn, archiveFileId);
const auto getArchiveFileTime = t.secs(utils::Timer::resetCounter);
if(nullptr == archiveFile.get()) {
exception::Exception ex;
ex.getMessage() << "No tape files found for archive file with ID " << archiveFileId;
exception::UserError ex;
ex.getMessage() << "No tape files available for archive file with archive file ID " << archiveFileId;
throw ex;
}
......@@ -4400,7 +4400,7 @@ common::dataStructures::RetrieveFileQueueCriteria RdbmsCatalogue::prepareToRetri
auto archiveFile = getArchiveFileToRetrieveByDiskFileId(conn, diskInstanceName, diskFileId);
const auto getArchiveFileTime = t.secs(utils::Timer::resetCounter);
if(nullptr == archiveFile.get()) {
exception::Exception ex;
exception::UserError ex;
ex.getMessage() << "No tape files available for archive file with disk instance name " << diskInstanceName <<
" and disk file ID" << diskFileId;
throw ex;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment