Commit 27ab6e2f authored by David COME's avatar David COME
Browse files

First attempt to give the user better error messages

parent 8ccd4325
......@@ -66,8 +66,8 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc) {
LogContext::ScopedParam(lc, Param("failed_Status", mb->m_failed))
};
tape::utils::suppresUnusedVariable(sp);
lc.log(LOG_ERR,"Failed to read from tape");
throw castor::tape::Exception("Failed to read from tape");
lc.log(LOG_ERR,mb->m_errorMsg);
throw castor::tape::Exception(mb->m_errorMsg);
}
mb->m_payload.write(ourFile);
checksum = mb->m_payload.adler32(checksum);
......
......@@ -82,6 +82,7 @@ public:
m_failed=false;
m_cancelled=false;
m_payload.reset();
m_errorMsg="";
}
/** Unique memory block id */
const int m_memoryBlockId;
......@@ -111,6 +112,7 @@ public:
previous failure. */
bool m_cancelled;
std::string m_errorMsg;
};
}
......
......@@ -163,7 +163,7 @@ public:
// mb might or might not be allocated at this point, but
// reportErrorToDiskTask will deal with the allocation if required.
reportErrorToDiskTask(mb);
reportErrorToDiskTask(ex.getMessageValue(),mb);
} //end of catch
watchdog.fileFinished();
}
......@@ -184,7 +184,7 @@ private:
* Do the actual report to the disk write task
* @param mb We assume that mb is a valid mem block
*/
void reportErrorToDiskTask(MemBlock* mb = NULL){
void reportErrorToDiskTask(const std::string& msg,MemBlock* mb = NULL){
//If we are not provided with a block, allocate it and
// fill it up
if (!mb) {
......@@ -194,6 +194,7 @@ private:
}
//mark the block failed and push it (plus signal the end)
mb->markAsFailed();
mb->m_errorMsg=msg;
m_fifo.pushDataBlock(mb);
m_fifo.pushDataBlock(NULL);
}
......
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