Commit cf633c7d authored by David COME's avatar David COME
Browse files

ErrorFlag is now in castor::tape::tapeserver::daemon within its own file

parent 6b74f179
......@@ -116,7 +116,7 @@ void DiskReadTask::execute(log::LogContext& lc) {
m_stats.filesCount++;
}
catch(const castor::tape::exceptions::ErrorFlag&){
catch(const castor::tape::tapeserver::daemon::ErrorFlag&){
lc.log(LOG_INFO,"DiskReadTask: a previous file has failed for migration "
"Do nothing except circulating blocks");
......
......@@ -26,6 +26,7 @@
#include "castor/tape/tapeserver/daemon/DataPipeline.hpp"
#include "castor/tape/tapeserver/daemon/DataConsumer.hpp"
#include "castor/tape/tapeserver/daemon/DiskStats.hpp"
#include "castor/tape/tapeserver/daemon/ErrorFlag.hpp"
#include "castor/tape/tapegateway/FileToMigrateStruct.hpp"
#include "castor/tape/tapeserver/threading/AtomicCounter.hpp"
#include "castor/log/LogContext.hpp"
......@@ -66,7 +67,7 @@ private:
void hasAnotherTaskTailed() const {
//if a task has signaled an error, we stop our job
if(m_errorFlag){
throw castor::tape::exceptions::ErrorFlag();
throw castor::tape::tapeserver::daemon::ErrorFlag();
}
}
......
/******************************************************************************
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#pragma once
#include "castor/exception/Exception.hpp"
namespace castor {
namespace tape {
namespace tapeserver {
namespace daemon {
/**
* Used to signal an error has happened during the migration process
*/
class ErrorFlag : public castor::exception::Exception {
public:
ErrorFlag(): castor::exception::Exception("Internal exception, should not be seen") {}
virtual ~ErrorFlag() throw() {}
};
}}}}
\ No newline at end of file
......@@ -23,7 +23,8 @@
#include "castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp"
#include "castor/tape/tapegateway/FilesToMigrateList.hpp"
#include "log.h"
#include "castor/tape/tapeserver/daemon/ErrorFlag.hpp"
//#include "log.h"
namespace{
/*
......@@ -189,7 +190,7 @@ namespace daemon {
try{
while(1){
if(m_parent.m_errorFlag){
throw castor::tape::exceptions::ErrorFlag();
throw castor::tape::tapeserver::daemon::ErrorFlag();
}
Request req = m_parent.m_queue.pop();
client::ClientProxy::RequestReport reqReport;
......@@ -210,7 +211,7 @@ namespace daemon {
}
} //end of while(1)
}//end of try
catch(const castor::tape::exceptions::ErrorFlag&){
catch(const castor::tape::tapeserver::daemon::ErrorFlag&){
//we end up there because a task screw up somewhere
m_parent.m_lc.log(LOG_ERR,"In MigrationTaskInjector::WorkerThread::run(): a task screw up, "
"finishing and discarding all tasks ");
......
......@@ -33,7 +33,7 @@
#include "castor/tape/tapeserver/daemon/MigrationReportPacker.hpp"
#include "castor/tape/tapeserver/daemon/TapeSessionStats.hpp"
#include "castor/tape/tapeserver/daemon/MemBlock.hpp"
#include "castor/tape/tapeserver/daemon/ErrorFlag.hpp"
namespace castor {
namespace tape {
namespace tapeserver {
......@@ -119,7 +119,7 @@ namespace daemon {
// Add the local counts to the session's
stats.add(localStats);
}
catch(const castor::tape::exceptions::ErrorFlag&){
catch(const castor::tape::tapeserver::daemon::ErrorFlag&){
//we end up there because another task has failed
//so we just log, circulate blocks and don't even send a report
lc.log(LOG_INFO,"TapeWriteTask: a previous file has failed for migration "
......@@ -234,7 +234,7 @@ namespace daemon {
void TapeWriteTask::hasAnotherTaskTailed() const {
//if a task has signaled an error, we stop our job
if(m_errorFlag){
throw castor::tape::exceptions::ErrorFlag();
throw castor::tape::tapeserver::daemon::ErrorFlag();
}
}
......
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