Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
907c02c3
Commit
907c02c3
authored
Aug 01, 2014
by
David COME
Browse files
EndOfFile is now a generic exception in castor/exception
parent
fa4e7053
Changes
3
Hide whitespace changes
Inline
Side-by-side
castor/exception/EndOfFile.hpp
0 → 100644
View file @
907c02c3
/******************************************************************************
*
* 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
castor/tape/tapeserver/daemon/Payload.hpp
View file @
907c02c3
...
...
@@ -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
::
exception
s
::
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
();
...
...
castor/tape/tapeserver/daemon/TapeReadTask.hpp
View file @
907c02c3
...
...
@@ -110,7 +110,7 @@ public:
while
(
mb
->
m_payload
.
append
(
*
rf
))
{
tapeBlock
++
;
}
}
catch
(
const
castor
::
tape
::
exception
s
::
EndOfFile
&
)
{
}
catch
(
const
castor
::
exception
::
EndOfFile
&
)
{
// append() signaled the end of the file.
stillReading
=
false
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment