diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 19582aa292e17bfefc2b1157adf2d6689f72d8b7..9ecc99cb92f1ac3cb5a68e25595baf3b7c86999c 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -76,6 +76,7 @@ set (COMMON_LIB_SRC_FILES exception/CommandLineNotParsed.cpp exception/InvalidArgument.cpp exception/InvalidConfigEntry.cpp + exception/MissingOperand.cpp log/DummyLogger.cpp log/LogContext.cpp log/Logger.cpp diff --git a/tapeserver/castor/exception/MissingOperand.cpp b/common/exception/MissingOperand.cpp similarity index 92% rename from tapeserver/castor/exception/MissingOperand.cpp rename to common/exception/MissingOperand.cpp index 68af96adec92bcf7acffc5bca7d88a2a6cc72869..9c447336c5561206fc515087ca2eb543ad509498 100644 --- a/tapeserver/castor/exception/MissingOperand.cpp +++ b/common/exception/MissingOperand.cpp @@ -21,12 +21,12 @@ * @author Castor Dev team, castor-dev@cern.ch *****************************************************************************/ -#include "castor/exception/MissingOperand.hpp" +#include "common/exception/MissingOperand.hpp" // ----------------------------------------------------------------------------- // Constructor // ----------------------------------------------------------------------------- -castor::exception::MissingOperand::MissingOperand(): +cta::exception::MissingOperand::MissingOperand(): cta::exception::Exception() { } diff --git a/tapeserver/castor/exception/MissingOperand.hpp b/common/exception/MissingOperand.hpp similarity index 94% rename from tapeserver/castor/exception/MissingOperand.hpp rename to common/exception/MissingOperand.hpp index 2c49d1c68c712614afc75bee68b91284aaf090c1..be0d757b2ba502505e6a9e7fcaece087358b996e 100644 --- a/tapeserver/castor/exception/MissingOperand.hpp +++ b/common/exception/MissingOperand.hpp @@ -25,7 +25,7 @@ #include "common/exception/Exception.hpp" -namespace castor { namespace exception { +namespace cta { namespace exception { /** * Missing operand. @@ -41,5 +41,5 @@ namespace castor { namespace exception { }; // class MissingOperand -} } // namespace castor exception +} } // namespace cta exception diff --git a/tapeserver/castor/mediachanger/CmdLine.cpp b/tapeserver/castor/mediachanger/CmdLine.cpp index 62648208e665768292488ec75b218a250fe8db5a..c87416e4fc52b9a226f9ca1232041a745c47efcf 100644 --- a/tapeserver/castor/mediachanger/CmdLine.cpp +++ b/tapeserver/castor/mediachanger/CmdLine.cpp @@ -23,14 +23,14 @@ #include "castor/mediachanger/CmdLine.hpp" #include "common/exception/InvalidArgument.hpp" -#include "castor/exception/MissingOperand.hpp" +#include "common/exception/MissingOperand.hpp" #include <getopt.h> //------------------------------------------------------------------------------ // handleMissingParameter //------------------------------------------------------------------------------ void castor::mediachanger::CmdLine::handleMissingParameter(const int opt) { - castor::exception::MissingOperand ex; + cta::exception::MissingOperand ex; ex.getMessage() << "The -" << (char)opt << " option requires a parameter"; throw ex; } diff --git a/tapeserver/castor/mediachanger/DismountCmd.hpp b/tapeserver/castor/mediachanger/DismountCmd.hpp index 7ad02259381fbb4de481fc720206f36b9cdc0c91..e838b279ecb5d359488bbd86535333bc341ecd15 100644 --- a/tapeserver/castor/mediachanger/DismountCmd.hpp +++ b/tapeserver/castor/mediachanger/DismountCmd.hpp @@ -24,7 +24,7 @@ #pragma once #include "common/exception/InvalidArgument.hpp" -#include "castor/exception/MissingOperand.hpp" +#include "common/exception/MissingOperand.hpp" #include "castor/mediachanger/CmdLineTool.hpp" #include "castor/mediachanger/DismountCmdLine.hpp" diff --git a/tapeserver/castor/mediachanger/DismountCmdLine.cpp b/tapeserver/castor/mediachanger/DismountCmdLine.cpp index b99ffbf9c0a2e126bacbbf74b1ca9efe87697c55..9915f98a99c8020a7fb071ddbc443eccf1b4144e 100644 --- a/tapeserver/castor/mediachanger/DismountCmdLine.cpp +++ b/tapeserver/castor/mediachanger/DismountCmdLine.cpp @@ -21,7 +21,7 @@ * @author Castor Dev team, castor-dev@cern.ch *****************************************************************************/ -#include "castor/exception/MissingOperand.hpp" +#include "common/exception/MissingOperand.hpp" #include "castor/mediachanger/DismountCmdLine.hpp" #include "castor/mediachanger/LibrarySlotParser.hpp" #include "common/exception/Exception.hpp" @@ -74,7 +74,7 @@ castor::mediachanger::DismountCmdLine::DismountCmdLine(const int argc, // Check that both VID and DRIVE_SLOT has been specified if(nbArgs < 2) { - castor::exception::MissingOperand ex; + cta::exception::MissingOperand ex; ex.getMessage() << "Both VID and DRIVE_SLOT must be specified"; throw ex; } diff --git a/tapeserver/castor/mediachanger/MountCmd.hpp b/tapeserver/castor/mediachanger/MountCmd.hpp index b89da3617fd0da7293df4e4e54fdede5c6811f65..5c107327c433fa7af4e4c480c34ff75b21e3818f 100644 --- a/tapeserver/castor/mediachanger/MountCmd.hpp +++ b/tapeserver/castor/mediachanger/MountCmd.hpp @@ -24,7 +24,7 @@ #pragma once #include "common/exception/InvalidArgument.hpp" -#include "castor/exception/MissingOperand.hpp" +#include "common/exception/MissingOperand.hpp" #include "castor/mediachanger/CmdLineTool.hpp" #include "castor/mediachanger/MountCmdLine.hpp" diff --git a/tapeserver/castor/mediachanger/MountCmdLine.cpp b/tapeserver/castor/mediachanger/MountCmdLine.cpp index 092657171d9c3e793bb81879ebcdf6b94dbfbbca..0a21549050eeaf21e725312288c3932f1bedbc85 100644 --- a/tapeserver/castor/mediachanger/MountCmdLine.cpp +++ b/tapeserver/castor/mediachanger/MountCmdLine.cpp @@ -21,7 +21,7 @@ * @author Castor Dev team, castor-dev@cern.ch *****************************************************************************/ -#include "castor/exception/MissingOperand.hpp" +#include "common/exception/MissingOperand.hpp" #include "castor/mediachanger/MountCmdLine.hpp" #include "common/exception/Exception.hpp" @@ -73,7 +73,7 @@ castor::mediachanger::MountCmdLine::MountCmdLine(const int argc, // Check that both VID and DRIVE_SLOT has been specified if(nbArgs < 2) { - castor::exception::MissingOperand ex; + cta::exception::MissingOperand ex; ex.getMessage() << "Both VID and DRIVE_SLOT must be specified"; throw ex; } diff --git a/tapeserver/castor/utils/CMakeLists.txt b/tapeserver/castor/utils/CMakeLists.txt index 3898a8b610c4c3c81784bb8d83022f80014ebc0b..eb312bfab501d6ec7e58f18767f76721eaebc3b6 100644 --- a/tapeserver/castor/utils/CMakeLists.txt +++ b/tapeserver/castor/utils/CMakeLists.txt @@ -33,7 +33,6 @@ set (UTILS_LIB_SRC_FILES ../exception/NoEntry.cpp ../exception/Errnum.cpp ../exception/NotAnOwner.cpp - ../exception/MissingOperand.cpp ../exception/NoPortInRange.cpp ../exception/TimeOut.cpp ../exception/OutOfMemory.cpp