diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 8258d2208d85c2bc9122aa1c18d1df33d3fde2e1..ed744e7d005c4b0845f5f0e5e4e9ec0fe02fc347 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -73,6 +73,7 @@ set (COMMON_LIB_SRC_FILES exception/UserError.cpp exception/AcceptConnectionInterrupted.cpp exception/BadAlloc.cpp + exception/CommandLineNotParsed.cpp log/DummyLogger.cpp log/LogContext.cpp log/Logger.cpp diff --git a/tapeserver/castor/exception/CommandLineNotParsed.cpp b/common/exception/CommandLineNotParsed.cpp similarity index 91% rename from tapeserver/castor/exception/CommandLineNotParsed.cpp rename to common/exception/CommandLineNotParsed.cpp index 900944c5d4da7c0f74350eaae945ddc47cbb7137..bacf705ccac7f2869dddf604796b7167c45f3c17 100644 --- a/tapeserver/castor/exception/CommandLineNotParsed.cpp +++ b/common/exception/CommandLineNotParsed.cpp @@ -21,12 +21,12 @@ * @author Castor Dev team, castor-dev@cern.ch *****************************************************************************/ -#include "castor/exception/CommandLineNotParsed.hpp" +#include "common/exception/CommandLineNotParsed.hpp" // ----------------------------------------------------------------------------- // Constructor // ----------------------------------------------------------------------------- -castor::exception::CommandLineNotParsed::CommandLineNotParsed(): +cta::exception::CommandLineNotParsed::CommandLineNotParsed(): cta::exception::Exception() { } diff --git a/tapeserver/castor/exception/CommandLineNotParsed.hpp b/common/exception/CommandLineNotParsed.hpp similarity index 94% rename from tapeserver/castor/exception/CommandLineNotParsed.hpp rename to common/exception/CommandLineNotParsed.hpp index 98f9fdf6797b0c233998e8748e9e41df53325c51..3f1b5455297a505c2bc669a2ea7d5d6237b4d935 100644 --- a/tapeserver/castor/exception/CommandLineNotParsed.hpp +++ b/common/exception/CommandLineNotParsed.hpp @@ -25,7 +25,7 @@ #include "common/exception/Exception.hpp" -namespace castor { namespace exception { +namespace cta { namespace exception { /** * CommandLineNotParsed. @@ -41,5 +41,5 @@ namespace castor { namespace exception { }; // class CommandLineNotParsed -} } // namespace castor exception +} } // namespace cta exception diff --git a/tapeserver/castor/server/Daemon.cpp b/tapeserver/castor/server/Daemon.cpp index a1eb60bc8d835bb53212a71db4b4d84acf646c63..677168f58f52de45d4ae6b510acb64a6088ae049 100644 --- a/tapeserver/castor/server/Daemon.cpp +++ b/tapeserver/castor/server/Daemon.cpp @@ -128,7 +128,7 @@ const std::string &castor::server::Daemon::getServerName() const throw() { bool castor::server::Daemon::getForeground() const { if(!m_commandLineHasBeenParsed) { - castor::exception::CommandLineNotParsed ex; + cta::exception::CommandLineNotParsed ex; ex.getMessage() << "Failed to determine whether or not the daemon should run in the" " foreground because the command-line has not yet been parsed"; diff --git a/tapeserver/castor/server/Daemon.hpp b/tapeserver/castor/server/Daemon.hpp index a09f66d6bc9ee4018a204527262178e6b84f8f2d..bf536cbb3826f062766ce8c6954ad08c33be84cc 100644 --- a/tapeserver/castor/server/Daemon.hpp +++ b/tapeserver/castor/server/Daemon.hpp @@ -21,7 +21,7 @@ #pragma once -#include "castor/exception/CommandLineNotParsed.hpp" +#include "common/exception/CommandLineNotParsed.hpp" #include "castor/log/Logger.hpp" #include "common/exception/Exception.hpp" diff --git a/tapeserver/castor/server/DaemonTest.cpp b/tapeserver/castor/server/DaemonTest.cpp index 28bd2e038826c101911d5ed4f3c14ca338ab0117..ed9f63a5a868be8db517690854fe7f2f3f39274d 100644 --- a/tapeserver/castor/server/DaemonTest.cpp +++ b/tapeserver/castor/server/DaemonTest.cpp @@ -64,7 +64,7 @@ TEST_F(castor_server_DaemonTest, getForegroundBeforeParseCommandLine) { castor::log::DummyLogger log(m_programName); castor::server::Daemon daemon(dummyStdOut, dummyStdErr, log); - ASSERT_THROW(daemon.getForeground(), castor::exception::CommandLineNotParsed); + ASSERT_THROW(daemon.getForeground(), cta::exception::CommandLineNotParsed); } TEST_F(castor_server_DaemonTest, parseEmptyCmdLine) { diff --git a/tapeserver/castor/utils/CMakeLists.txt b/tapeserver/castor/utils/CMakeLists.txt index 8f4cd381c71e2cc2e8577d261ae952a5a85ff0cb..8ce6f2c03f0967e6bb10c9918bb2e78113929588 100644 --- a/tapeserver/castor/utils/CMakeLists.txt +++ b/tapeserver/castor/utils/CMakeLists.txt @@ -38,7 +38,6 @@ set (UTILS_LIB_SRC_FILES ../exception/MissingOperand.cpp ../exception/NoPortInRange.cpp ../exception/TimeOut.cpp - ../exception/CommandLineNotParsed.cpp ../exception/OutOfMemory.cpp ../BaseObject.cpp ../Services.cpp