Commit fe4fb905 authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Renamed castor::exception::InvalidArgument to

cta::exception::InvalidArgument
parent c55e47e3
......@@ -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
......
......@@ -24,10 +24,10 @@
// Include Files
#include <errno.h>
#include "castor/exception/InvalidArgument.hpp"
#include "common/exception/InvalidArgument.hpp"
// -----------------------------------------------------------------------
// Constructor
// -----------------------------------------------------------------------
castor::exception::InvalidArgument::InvalidArgument(const std::string& what) :
cta::exception::InvalidArgument::InvalidArgument(const std::string& what) :
cta::exception::Exception(what) {}
......@@ -27,7 +27,7 @@
// Include Files
#include "common/exception/Exception.hpp"
namespace castor {
namespace cta {
namespace exception {
......@@ -47,5 +47,5 @@ namespace castor {
} // end of namespace exception
} // end of namespace castor
} // end of namespace cta
......@@ -22,7 +22,7 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include "castor/exception/InvalidArgument.hpp"
#include "common/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) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
ex.getMessage() << "lowPort must be greater than 0"
": lowPort=" << lowPort;
throw ex;
}
if(highPort < 1) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
ex.getMessage() << "highPort must be greater than 0"
": highPort=" << lowPort;
throw ex;
}
if(lowPort > highPort) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::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) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
ex.getMessage() <<
"In io::writeBytes: Invalid timeout value: " << timeout;
throw ex;
......
......@@ -25,7 +25,7 @@
#pragma once
#include "common/exception/AcceptConnectionInterrupted.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "common/exception/InvalidArgument.hpp"
#include "castor/exception/NoPortInRange.hpp"
#include "castor/exception/TimeOut.hpp"
#include "castor/io/Constants.hpp"
......
......@@ -27,7 +27,7 @@
// constructor
//------------------------------------------------------------------------------
castor::log::DummyLogger::DummyLogger(const std::string &programName)
throw(cta::exception::Exception, castor::exception::InvalidArgument):
throw(cta::exception::Exception, cta::exception::InvalidArgument):
Logger(programName) {
}
......
......@@ -48,7 +48,7 @@ public:
* message.
*/
DummyLogger(const std::string &programName)
throw(cta::exception::Exception, castor::exception::InvalidArgument);
throw(cta::exception::Exception, cta::exception::InvalidArgument);
/**
* Destructor.
......
......@@ -27,7 +27,7 @@
// constructor
//------------------------------------------------------------------------------
castor::log::Logger::Logger(const std::string &programName)
throw(cta::exception::Exception, castor::exception::InvalidArgument):
throw(cta::exception::Exception, cta::exception::InvalidArgument):
m_programName(programName) {
}
......
......@@ -25,7 +25,7 @@
#pragma once
// Include Files
#include "castor/exception/InvalidArgument.hpp"
#include "common/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, castor::exception::InvalidArgument);
throw(cta::exception::Exception, cta::exception::InvalidArgument);
/**
* Destructor.
......
......@@ -41,7 +41,7 @@
//------------------------------------------------------------------------------
castor::log::StringLogger::StringLogger(
const std::string &programName)
throw(cta::exception::Exception, castor::exception::InvalidArgument):
throw(cta::exception::Exception, cta::exception::InvalidArgument):
Logger(programName),
m_maxMsgLen(determineMaxMsgLen()),
m_priorityToText(generatePriorityToTextMap()) {
......
......@@ -55,7 +55,7 @@ public:
* message.
*/
StringLogger(const std::string &programName)
throw(cta::exception::Exception, castor::exception::InvalidArgument);
throw(cta::exception::Exception, cta::exception::InvalidArgument);
/**
* Destructor.
......
......@@ -42,7 +42,7 @@
//------------------------------------------------------------------------------
castor::log::SyslogLogger::SyslogLogger(
const std::string &programName)
throw(cta::exception::Exception, castor::exception::InvalidArgument):
throw(cta::exception::Exception, cta::exception::InvalidArgument):
Logger(programName),
m_maxMsgLen(determineMaxMsgLen()),
m_logFile(-1),
......
......@@ -54,7 +54,7 @@ public:
* message.
*/
SyslogLogger(const std::string &programName)
throw(cta::exception::Exception, castor::exception::InvalidArgument);
throw(cta::exception::Exception, cta::exception::InvalidArgument);
/**
* Destructor.
......
......@@ -43,7 +43,7 @@ public:
* message.
*/
TestingSyslogLogger(const std::string &programName)
throw(cta::exception::Exception, castor::exception::InvalidArgument):
throw(cta::exception::Exception, cta::exception::InvalidArgument):
SyslogLogger(programName) {
}
......
......@@ -21,7 +21,7 @@
#pragma once
#include "castor/exception/InvalidArgument.hpp"
#include "common/exception/InvalidArgument.hpp"
#include "castor/mediachanger/LibrarySlot.hpp"
#include <stdint.h>
......
......@@ -22,7 +22,7 @@
*****************************************************************************/
#include "castor/mediachanger/CmdLine.hpp"
#include "castor/exception/InvalidArgument.hpp"
#include "common/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) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
if(0 == optopt) {
ex.getMessage() << "Unknown command-line option";
} else {
......
......@@ -23,7 +23,7 @@
#pragma once
#include "castor/exception/InvalidArgument.hpp"
#include "common/exception/InvalidArgument.hpp"
#include "castor/exception/MissingOperand.hpp"
#include "castor/mediachanger/CmdLineTool.hpp"
#include "castor/mediachanger/DismountCmdLine.hpp"
......
......@@ -118,7 +118,7 @@ castor::mediachanger::AcsLibrarySlot *castor::mediachanger::LibrarySlotParser::
std::vector<std::string> components;
castor::utils::splitString(str, ',', components);
if(4 != components.size()) {
castor::exception::InvalidArgument ex;
cta::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")) {
castor::exception::InvalidArgument ex;
cta::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()) {
castor::exception::InvalidArgument ex;
cta::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()) {
castor::exception::InvalidArgument ex;
cta::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()) {
castor::exception::InvalidArgument ex;
cta::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()) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
ex.getMessage() << errMsg << ": Invalid TRANSPORT_NUMBER string length"
": expected=1..3, actual=" << drvStr.length();
throw ex;
}
if(!utils::isValidUInt(acsStr)) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
ex.getMessage() << errMsg << ": ACS_NUMBER must be an unsigned integer:"
" value=" << acsStr;
throw ex;
}
if(!utils::isValidUInt(lsmStr)) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
ex.getMessage() << errMsg << ": LSM_NUMBER must be an unsigned integer:"
" value=" << lsmStr;
throw ex;
}
if(!utils::isValidUInt(panStr)) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
ex.getMessage() << errMsg << ": PANEL_NUMBER must be an unsigned integer:"
" value=" << panStr;
throw ex;
}
if(!utils::isValidUInt(drvStr)) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
ex.getMessage() << errMsg << ": TRANSPORT_NUMBER must be an unsigned"
" integer: value=" << drvStr;
throw ex;
......
......@@ -23,7 +23,7 @@
#pragma once
#include "castor/exception/InvalidArgument.hpp"
#include "common/exception/InvalidArgument.hpp"
#include "castor/exception/MissingOperand.hpp"
#include "castor/exception/MountFailed.hpp"
#include "castor/mediachanger/CmdLineTool.hpp"
......
......@@ -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) {
castor::exception::InvalidArgument ex;
cta::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()) {
castor::exception::InvalidArgument ex;
cta::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()) {
castor::exception::InvalidArgument ex;
cta::exception::InvalidArgument ex;
ex.getMessage() <<
"Failed to parse TPCONFIG file"
": logical library is too long"
......
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