Skip to content
Snippets Groups Projects
Commit 9fd5eda7 authored by Steven Murray's avatar Steven Murray
Browse files

The RecallReportPackerBadBadEnd is finally complete

parent bd454961
Branches
Tags
No related merge requests found
......@@ -48,7 +48,7 @@ void cta::RetrieveJob::complete(const uint32_t checksumOfTransfer,
//------------------------------------------------------------------------------
// failed
//------------------------------------------------------------------------------
void cta::RetrieveJob::failed(const std::exception &ex) {
void cta::RetrieveJob::failed(const exception::Exception &ex) {
}
//------------------------------------------------------------------------------
......
......@@ -95,7 +95,7 @@ public:
*
* @param ex The reason for the failure.
*/
virtual void failed(const std::exception &ex);
virtual void failed(const exception::Exception &ex);
/**
* Indicates that the job should be tried again (typically reaching the end
......
......@@ -68,8 +68,8 @@ void RecallReportPacker::reportCompletedJob(std::unique_ptr<cta::RetrieveJob> su
//------------------------------------------------------------------------------
//reportFailedJob
//------------------------------------------------------------------------------
void RecallReportPacker::reportFailedJob(std::unique_ptr<cta::RetrieveJob> failedRetrieveJob
, const std::exception &ex){
void RecallReportPacker::reportFailedJob(std::unique_ptr<cta::RetrieveJob> failedRetrieveJob,
const castor::exception::Exception &ex){
std::unique_ptr<Report> rep(new ReportError(std::move(failedRetrieveJob),ex));
castor::server::MutexLocker ml(&m_producterProtection);
m_fifo.push(rep.release());
......@@ -152,7 +152,8 @@ void RecallReportPacker::ReportEndofSessionWithErrors::execute(RecallReportPacke
//------------------------------------------------------------------------------
void RecallReportPacker::ReportError::execute(RecallReportPacker& parent){
parent.m_errorHappened=true;
m_failedRetrieveJob->failed(m_ex);
parent.m_lc.log(LOG_ERR,m_ex.getMessageValue());
m_failedRetrieveJob->failed(cta::exception::Exception(m_ex.getMessageValue()));
}
//------------------------------------------------------------------------------
//WorkerThread::WorkerThread
......
......@@ -62,7 +62,7 @@ public:
* @param migratedFile the file which failed
* @param ex the reason for the failure
*/
virtual void reportFailedJob(std::unique_ptr<cta::RetrieveJob> failedRetrieveJob, const std::exception& ex);
virtual void reportFailedJob(std::unique_ptr<cta::RetrieveJob> failedRetrieveJob, const castor::exception::Exception& ex);
/**
* Create into the MigrationReportPacker a report for the nominal end of session
......@@ -116,14 +116,14 @@ private:
virtual void execute(RecallReportPacker& reportPacker);
};
class ReportError : public Report {
const std::exception m_ex;
const castor::exception::Exception m_ex;
/**
* The failed retrieve job to be reported immediately
*/
std::unique_ptr<cta::RetrieveJob> m_failedRetrieveJob;
public:
ReportError(std::unique_ptr<cta::RetrieveJob> failedRetrieveJob, const std::exception &ex):
ReportError(std::unique_ptr<cta::RetrieveJob> failedRetrieveJob, const castor::exception::Exception &ex):
Report(false),
m_ex(ex),
m_failedRetrieveJob(std::move(failedRetrieveJob)) {
......
......@@ -53,7 +53,7 @@ protected:
MOCK_METHOD2(complete, void(const uint32_t checksumOfTransfer, const uint64_t fileSizeOfTransfer));
MOCK_METHOD1(failed, void(const std::exception &ex));
MOCK_METHOD1(failed, void(const cta::exception::Exception &ex));
}; // class MockRetrieveJob
class MockRetrieveMount: public cta::RetrieveMount {
......@@ -164,7 +164,7 @@ TEST_F(castor_tape_tapeserver_daemonTest, RecallReportPackerBadBadEnd) {
rrp.reportCompletedJob(std::move(job2),0,0);
const std::string error_msg = "ERROR_TEST_MSG";
const cta::exception::Exception ex(error_msg);
const castor::exception::Exception ex(error_msg);
rrp.reportFailedJob(std::move(job3),ex);
rrp.reportEndOfSession();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment