Skip to content
Snippets Groups Projects
Commit ef832e0f authored by Jorge Camarero Vera's avatar Jorge Camarero Vera
Browse files

Caught the No drive found in configuration exception

parent 50c96662
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,8 @@
- cta/CTA#41 - Delete verification_status of tape when tape is reclaimed
- cta/CTA#153 - Allow verification status to be cleared with cta-admin
- cta/CTA#173 - Update release notes and small changes to refactoring of operation tools cmd line parsing - Compatible with operations 0.4-95 or later
### Bug fixes
### Bug fixes
- cta/CTA#48 - Catch tape server exception and log an error instead
- cta/CTA#161 - Fix bug when using temporary tables with PostgreSQL
# v4.7.12-1
......
......@@ -14,18 +14,20 @@
* granted to it by virtue of its status as an Intergovernmental Organization or
* submit itself to any jurisdiction.
*/
#include <limits.h>
#include <sys/prctl.h>
#include <google/protobuf/service.h>
#include "TapeDaemon.hpp"
#include "common/exception/Errnum.hpp"
#include "common/exception/NoSuchObject.hpp"
#include "common/utils/utils.hpp"
#include "tapeserver/daemon/CommandLineParams.hpp"
#include "ProcessManager.hpp"
#include "SignalHandler.hpp"
#include "DriveHandler.hpp"
#include "MaintenanceHandler.hpp"
#include <google/protobuf/service.h>
#include <limits.h>
#include <sys/prctl.h>
#include "tapeserver/daemon/DriveHandler.hpp"
#include "tapeserver/daemon/MaintenanceHandler.hpp"
#include "tapeserver/daemon/ProcessManager.hpp"
#include "tapeserver/daemon/SignalHandler.hpp"
#include "tapeserver/daemon/TapeDaemon.hpp"
namespace cta { namespace tape { namespace daemon {
......@@ -49,6 +51,9 @@ TapeDaemon::~TapeDaemon() {
int TapeDaemon::main() {
try {
exceptionThrowingMain();
} catch (cta::exception::NoSuchObject &ex) {
m_log(log::ERR, "Aborting cta-taped. Not starting because: " + ex.getMessage().str());
return 2;
} catch (cta::exception::Exception &ex) {
// Log the error
m_log(log::ERR, "Aborting cta-taped on uncaught exception. Stack trace follows.", {{"Message", ex.getMessage().str()}});
......@@ -73,8 +78,8 @@ std::string cta::tape::daemon::TapeDaemon::getHostName() const {
// exceptionThrowingMain
//------------------------------------------------------------------------------
void cta::tape::daemon::TapeDaemon::exceptionThrowingMain() {
if(m_globalConfiguration.driveConfigs.empty())
throw cta::exception::Exception("No drive found in configuration");
if (m_globalConfiguration.driveConfigs.empty())
throw cta::exception::NoSuchObject("No drive found in configuration");
// Process must be able to change user now and should be permitted to perform
// raw IO in the future
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment