Commit 907c02c3 authored by David COME's avatar David COME
Browse files

EndOfFile is now a generic exception in castor/exception

parent fa4e7053
/******************************************************************************
*
* 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"
#include <string>
namespace castor {
namespace exception {
class EndOfFile: public castor::exception::Exception {
public:
EndOfFile(const std::string & w): castor::exception::Exception(w) {}
virtual ~EndOfFile() throw() {}
};
}}
\ No newline at end of file
......@@ -24,6 +24,7 @@
#include "castor/tape/tapeserver/file/DiskFile.hpp"
#include "castor/tape/tapeserver/file/File.hpp"
#include "castor/exception/MemException.hpp"
#include "castor/exception/EndOfFile.hpp"
#pragma once
namespace castor {
......@@ -109,7 +110,7 @@ public:
try {
readSize = from.read(m_data + m_size, from.getBlockSize());
} catch (castor::tape::tapeFile::EndOfFile&) {
throw castor::tape::exceptions::EndOfFile("In castor::tape::tapeserver::daemon::Payload::append: reached end of file");
throw castor::exception::EndOfFile("In castor::tape::tapeserver::daemon::Payload::append: reached end of file");
}
m_size += readSize;
return from.getBlockSize() <= remainingFreeSpace();
......
......@@ -110,7 +110,7 @@ public:
while (mb->m_payload.append(*rf)) {
tapeBlock++;
}
} catch (const castor::tape::exceptions::EndOfFile&) {
} catch (const castor::exception::EndOfFile&) {
// append() signaled the end of the file.
stillReading = false;
}
......
Markdown is supported
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