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
fe4fb905
Commit
fe4fb905
authored
Aug 30, 2016
by
Victor Kotlyar
Browse files
Renamed castor::exception::InvalidArgument to
cta::exception::InvalidArgument
parent
c55e47e3
Changes
26
Hide whitespace changes
Inline
Side-by-side
common/CMakeLists.txt
View file @
fe4fb905
...
...
@@ -74,6 +74,7 @@ set (COMMON_LIB_SRC_FILES
exception/AcceptConnectionInterrupted.cpp
exception/BadAlloc.cpp
exception/CommandLineNotParsed.cpp
exception/InvalidArgument.cpp
log/DummyLogger.cpp
log/LogContext.cpp
log/Logger.cpp
...
...
tapeserver/castor
/exception/InvalidArgument.cpp
→
common
/exception/InvalidArgument.cpp
View file @
fe4fb905
...
...
@@ -24,10 +24,10 @@
// Include Files
#include
<errno.h>
#include
"c
astor
/exception/InvalidArgument.hpp"
#include
"c
ommon
/exception/InvalidArgument.hpp"
// -----------------------------------------------------------------------
// Constructor
// -----------------------------------------------------------------------
ca
stor
::
exception
::
InvalidArgument
::
InvalidArgument
(
const
std
::
string
&
what
)
:
c
t
a
::
exception
::
InvalidArgument
::
InvalidArgument
(
const
std
::
string
&
what
)
:
cta
::
exception
::
Exception
(
what
)
{}
tapeserver/castor
/exception/InvalidArgument.hpp
→
common
/exception/InvalidArgument.hpp
View file @
fe4fb905
...
...
@@ -27,7 +27,7 @@
// Include Files
#include
"common/exception/Exception.hpp"
namespace
ca
stor
{
namespace
c
t
a
{
namespace
exception
{
...
...
@@ -47,5 +47,5 @@ namespace castor {
}
// end of namespace exception
}
// end of namespace ca
stor
}
// end of namespace c
t
a
tapeserver/castor/io/io.cpp
View file @
fe4fb905
...
...
@@ -22,7 +22,7 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include
"c
astor
/exception/InvalidArgument.hpp"
#include
"c
ommon
/exception/InvalidArgument.hpp"
#include
"castor/io/io.hpp"
#include
"castor/utils/SmartFd.hpp"
#include
"castor/utils/utils.hpp"
...
...
@@ -110,19 +110,19 @@ int castor::io::createListenerSock(
// Check range validity
if
(
lowPort
<
1
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"lowPort must be greater than 0"
": lowPort="
<<
lowPort
;
throw
ex
;
}
if
(
highPort
<
1
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"highPort must be greater than 0"
": highPort="
<<
lowPort
;
throw
ex
;
}
if
(
lowPort
>
highPort
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"lowPort must be less than or equal to highPort"
": lowPort="
<<
lowPort
<<
" highPort="
<<
highPort
;
throw
ex
;
...
...
@@ -251,7 +251,7 @@ int castor::io::acceptConnection(const int listenSocketFd)
// Throw an exception if listenSocketFd is invalid
if
(
listenSocketFd
<
0
)
{
exception
::
InvalidArgument
ex
;
cta
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
": Invalid listen socket file-descriptor"
": listenSocketFd="
<<
listenSocketFd
;
...
...
@@ -297,7 +297,7 @@ int castor::io::acceptConnection(const int listenSocketFd,
// Throw an exception if listenSocketFd is invalid
if
(
listenSocketFd
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Invalid listen socket file-descriptor"
": listenSocketFd="
<<
listenSocketFd
;
...
...
@@ -402,7 +402,7 @@ castor::io::IpAndPort castor::io::getSockIpPort(
// Throw an exception if socketFd is invalid
if
(
socketFd
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Invalid socket file-descriptor"
": socketFd="
<<
socketFd
;
...
...
@@ -431,7 +431,7 @@ castor::io::IpAndPort castor::io::getPeerIpPort(
// Throw an exception if socketFd is invalid
if
(
socketFd
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Invalid socket file-descriptor"
": socketFd="
<<
socketFd
;
...
...
@@ -459,7 +459,7 @@ std::string castor::io::getSockHostName(const int socketFd) {
// Throw an exception if socketFd is invalid
if
(
socketFd
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Failed to get socket hostname"
": Invalid socket file-descriptor"
": socketFd="
<<
socketFd
;
...
...
@@ -506,7 +506,7 @@ void castor::io::getSockIpHostnamePort(
// Throw an exception if socketFd is invalid
if
(
socketFd
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Invalid socket file-descriptor"
": socketFd="
<<
socketFd
;
...
...
@@ -550,7 +550,7 @@ void castor::io::getSockIpHostnamePort(
std
::
string
castor
::
io
::
getPeerHostName
(
const
int
socketFd
)
{
// Throw an exception if socketFd is invalid
if
(
socketFd
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Invalid socket file-descriptor"
": socketFd="
<<
socketFd
;
...
...
@@ -611,7 +611,7 @@ void castor::io::writeSockDescription(
// Throw an exception if socketFd is invalid
if
(
socketFd
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Invalid socket file-descriptor"
": socketFd="
<<
socketFd
;
...
...
@@ -653,7 +653,7 @@ void castor::io::readBytes(
char
*
const
buf
)
{
// Throw an exception if socketFd is invalid
if
(
socketFd
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"In io::readBytes: Invalid socket file-descriptor"
": socketFd="
<<
socketFd
;
...
...
@@ -661,7 +661,7 @@ void castor::io::readBytes(
}
if
(
timeout
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"In io::readBytes: Invalid timeout value: "
<<
timeout
;
throw
ex
;
...
...
@@ -718,7 +718,7 @@ void castor::io::writeBytes(
// Throw an exception if socketFd is invalid
if
(
socketFd
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"In io::writeBytes: Invalid socket file-descriptor"
": socketFd="
<<
socketFd
;
...
...
@@ -726,7 +726,7 @@ void castor::io::writeBytes(
}
if
(
timeout
<
0
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"In io::writeBytes: Invalid timeout value: "
<<
timeout
;
throw
ex
;
...
...
tapeserver/castor/io/io.hpp
View file @
fe4fb905
...
...
@@ -25,7 +25,7 @@
#pragma once
#include
"common/exception/AcceptConnectionInterrupted.hpp"
#include
"c
astor
/exception/InvalidArgument.hpp"
#include
"c
ommon
/exception/InvalidArgument.hpp"
#include
"castor/exception/NoPortInRange.hpp"
#include
"castor/exception/TimeOut.hpp"
#include
"castor/io/Constants.hpp"
...
...
tapeserver/castor/log/DummyLogger.cpp
View file @
fe4fb905
...
...
@@ -27,7 +27,7 @@
// constructor
//------------------------------------------------------------------------------
castor
::
log
::
DummyLogger
::
DummyLogger
(
const
std
::
string
&
programName
)
throw
(
cta
::
exception
::
Exception
,
ca
stor
::
exception
::
InvalidArgument
)
:
throw
(
cta
::
exception
::
Exception
,
c
t
a
::
exception
::
InvalidArgument
)
:
Logger
(
programName
)
{
}
...
...
tapeserver/castor/log/DummyLogger.hpp
View file @
fe4fb905
...
...
@@ -48,7 +48,7 @@ public:
* message.
*/
DummyLogger
(
const
std
::
string
&
programName
)
throw
(
cta
::
exception
::
Exception
,
ca
stor
::
exception
::
InvalidArgument
);
throw
(
cta
::
exception
::
Exception
,
c
t
a
::
exception
::
InvalidArgument
);
/**
* Destructor.
...
...
tapeserver/castor/log/Logger.cpp
View file @
fe4fb905
...
...
@@ -27,7 +27,7 @@
// constructor
//------------------------------------------------------------------------------
castor
::
log
::
Logger
::
Logger
(
const
std
::
string
&
programName
)
throw
(
cta
::
exception
::
Exception
,
ca
stor
::
exception
::
InvalidArgument
)
:
throw
(
cta
::
exception
::
Exception
,
c
t
a
::
exception
::
InvalidArgument
)
:
m_programName
(
programName
)
{
}
...
...
tapeserver/castor/log/Logger.hpp
View file @
fe4fb905
...
...
@@ -25,7 +25,7 @@
#pragma once
// Include Files
#include
"c
astor
/exception/InvalidArgument.hpp"
#include
"c
ommon
/exception/InvalidArgument.hpp"
#include
"castor/log/Param.hpp"
#include
<list>
...
...
@@ -95,7 +95,7 @@ public:
* message.
*/
Logger
(
const
std
::
string
&
programName
)
throw
(
cta
::
exception
::
Exception
,
ca
stor
::
exception
::
InvalidArgument
);
throw
(
cta
::
exception
::
Exception
,
c
t
a
::
exception
::
InvalidArgument
);
/**
* Destructor.
...
...
tapeserver/castor/log/StringLogger.cpp
View file @
fe4fb905
...
...
@@ -41,7 +41,7 @@
//------------------------------------------------------------------------------
castor
::
log
::
StringLogger
::
StringLogger
(
const
std
::
string
&
programName
)
throw
(
cta
::
exception
::
Exception
,
ca
stor
::
exception
::
InvalidArgument
)
:
throw
(
cta
::
exception
::
Exception
,
c
t
a
::
exception
::
InvalidArgument
)
:
Logger
(
programName
),
m_maxMsgLen
(
determineMaxMsgLen
()),
m_priorityToText
(
generatePriorityToTextMap
())
{
...
...
tapeserver/castor/log/StringLogger.hpp
View file @
fe4fb905
...
...
@@ -55,7 +55,7 @@ public:
* message.
*/
StringLogger
(
const
std
::
string
&
programName
)
throw
(
cta
::
exception
::
Exception
,
ca
stor
::
exception
::
InvalidArgument
);
throw
(
cta
::
exception
::
Exception
,
c
t
a
::
exception
::
InvalidArgument
);
/**
* Destructor.
...
...
tapeserver/castor/log/SyslogLogger.cpp
View file @
fe4fb905
...
...
@@ -42,7 +42,7 @@
//------------------------------------------------------------------------------
castor
::
log
::
SyslogLogger
::
SyslogLogger
(
const
std
::
string
&
programName
)
throw
(
cta
::
exception
::
Exception
,
ca
stor
::
exception
::
InvalidArgument
)
:
throw
(
cta
::
exception
::
Exception
,
c
t
a
::
exception
::
InvalidArgument
)
:
Logger
(
programName
),
m_maxMsgLen
(
determineMaxMsgLen
()),
m_logFile
(
-
1
),
...
...
tapeserver/castor/log/SyslogLogger.hpp
View file @
fe4fb905
...
...
@@ -54,7 +54,7 @@ public:
* message.
*/
SyslogLogger
(
const
std
::
string
&
programName
)
throw
(
cta
::
exception
::
Exception
,
ca
stor
::
exception
::
InvalidArgument
);
throw
(
cta
::
exception
::
Exception
,
c
t
a
::
exception
::
InvalidArgument
);
/**
* Destructor.
...
...
tapeserver/castor/log/TestingSyslogLogger.hpp
View file @
fe4fb905
...
...
@@ -43,7 +43,7 @@ public:
* message.
*/
TestingSyslogLogger
(
const
std
::
string
&
programName
)
throw
(
cta
::
exception
::
Exception
,
ca
stor
::
exception
::
InvalidArgument
)
:
throw
(
cta
::
exception
::
Exception
,
c
t
a
::
exception
::
InvalidArgument
)
:
SyslogLogger
(
programName
)
{
}
...
...
tapeserver/castor/mediachanger/AcsLibrarySlot.hpp
View file @
fe4fb905
...
...
@@ -21,7 +21,7 @@
#pragma once
#include
"c
astor
/exception/InvalidArgument.hpp"
#include
"c
ommon
/exception/InvalidArgument.hpp"
#include
"castor/mediachanger/LibrarySlot.hpp"
#include
<stdint.h>
...
...
tapeserver/castor/mediachanger/CmdLine.cpp
View file @
fe4fb905
...
...
@@ -22,7 +22,7 @@
*****************************************************************************/
#include
"castor/mediachanger/CmdLine.hpp"
#include
"c
astor
/exception/InvalidArgument.hpp"
#include
"c
ommon
/exception/InvalidArgument.hpp"
#include
"castor/exception/MissingOperand.hpp"
#include
<getopt.h>
...
...
@@ -39,7 +39,7 @@ void castor::mediachanger::CmdLine::handleMissingParameter(const int opt) {
// handleUnknownOption
//------------------------------------------------------------------------------
void
castor
::
mediachanger
::
CmdLine
::
handleUnknownOption
(
const
int
opt
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
if
(
0
==
optopt
)
{
ex
.
getMessage
()
<<
"Unknown command-line option"
;
}
else
{
...
...
tapeserver/castor/mediachanger/DismountCmd.hpp
View file @
fe4fb905
...
...
@@ -23,7 +23,7 @@
#pragma once
#include
"c
astor
/exception/InvalidArgument.hpp"
#include
"c
ommon
/exception/InvalidArgument.hpp"
#include
"castor/exception/MissingOperand.hpp"
#include
"castor/mediachanger/CmdLineTool.hpp"
#include
"castor/mediachanger/DismountCmdLine.hpp"
...
...
tapeserver/castor/mediachanger/LibrarySlotParser.cpp
View file @
fe4fb905
...
...
@@ -118,7 +118,7 @@ castor::mediachanger::AcsLibrarySlot *castor::mediachanger::LibrarySlotParser::
std
::
vector
<
std
::
string
>
components
;
castor
::
utils
::
splitString
(
str
,
','
,
components
);
if
(
4
!=
components
.
size
())
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": Invalid number of components"
": expected=4, actual="
<<
components
.
size
();
throw
ex
;
...
...
@@ -127,7 +127,7 @@ castor::mediachanger::AcsLibrarySlot *castor::mediachanger::LibrarySlotParser::
// check for acs in the beginning
const
std
::
string
&
acsWithACS_NUMBERStr
=
components
[
0
];
if
(
0
!=
acsWithACS_NUMBERStr
.
find
(
"acs"
))
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": Invalid tape library-slot format"
": expected=acsACS_NUMBER, actual="
<<
acsWithACS_NUMBERStr
;
throw
ex
;
...
...
@@ -141,50 +141,50 @@ castor::mediachanger::AcsLibrarySlot *castor::mediachanger::LibrarySlotParser::
// Each of the 4 components must be between 1 and than 3 characters long
if
(
1
>
acsStr
.
length
()
||
3
<
acsStr
.
length
())
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": Invalid ACS_NUMBER string length"
": expected=1..3, actual="
<<
acsStr
.
length
();
throw
ex
;
}
if
(
1
>
lsmStr
.
length
()
||
3
<
lsmStr
.
length
())
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": Invalid LSM_NUMBER string length"
": expected=1..3, actual="
<<
lsmStr
.
length
();
throw
ex
;
}
if
(
1
>
panStr
.
length
()
||
3
<
panStr
.
length
())
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": Invalid PANEL_NUMBER string length"
": expected=1..3, actual="
<<
panStr
.
length
();
throw
ex
;
}
if
(
1
>
drvStr
.
length
()
||
3
<
drvStr
.
length
())
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": Invalid TRANSPORT_NUMBER string length"
": expected=1..3, actual="
<<
drvStr
.
length
();
throw
ex
;
}
if
(
!
utils
::
isValidUInt
(
acsStr
))
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": ACS_NUMBER must be an unsigned integer:"
" value="
<<
acsStr
;
throw
ex
;
}
if
(
!
utils
::
isValidUInt
(
lsmStr
))
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": LSM_NUMBER must be an unsigned integer:"
" value="
<<
lsmStr
;
throw
ex
;
}
if
(
!
utils
::
isValidUInt
(
panStr
))
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": PANEL_NUMBER must be an unsigned integer:"
" value="
<<
panStr
;
throw
ex
;
}
if
(
!
utils
::
isValidUInt
(
drvStr
))
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
errMsg
<<
": TRANSPORT_NUMBER must be an unsigned"
" integer: value="
<<
drvStr
;
throw
ex
;
...
...
tapeserver/castor/mediachanger/MountCmd.hpp
View file @
fe4fb905
...
...
@@ -23,7 +23,7 @@
#pragma once
#include
"c
astor
/exception/InvalidArgument.hpp"
#include
"c
ommon
/exception/InvalidArgument.hpp"
#include
"castor/exception/MissingOperand.hpp"
#include
"castor/exception/MountFailed.hpp"
#include
"castor/mediachanger/CmdLineTool.hpp"
...
...
tapeserver/castor/tape/tapeserver/daemon/TpconfigLines.cpp
View file @
fe4fb905
...
...
@@ -103,7 +103,7 @@ castor::tape::tapeserver::daemon::TpconfigLines castor::tape::tapeserver::
// Throw an exception if the number of data-columns is invalid
if
(
columns
.
size
()
!=
expectedNbOfColumns
)
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Failed to parse TPCONFIG file"
": Invalid number of data columns in TPCONFIG line"
...
...
@@ -123,7 +123,7 @@ castor::tape::tapeserver::daemon::TpconfigLines castor::tape::tapeserver::
);
if
(
CA_MAXUNMLEN
<
configLine
.
unitName
.
length
())
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Failed to parse TPCONFIG file"
": Tape-drive unit-name is too long"
...
...
@@ -136,7 +136,7 @@ castor::tape::tapeserver::daemon::TpconfigLines castor::tape::tapeserver::
}
if
(
CA_MAXDGNLEN
<
configLine
.
logicalLibrary
.
length
())
{
ca
stor
::
exception
::
InvalidArgument
ex
;
c
t
a
::
exception
::
InvalidArgument
ex
;
ex
.
getMessage
()
<<
"Failed to parse TPCONFIG file"
": logical library is too long"
...
...
Prev
1
2
Next
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