diff --git a/ReleaseNotes.md b/ReleaseNotes.md index ad6aeda97d857328c79c06ac02d5e18290a80b19..1b543923773f5b3425cd499b607cfe89db41a04d 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -8,6 +8,7 @@ - cta/CTA#224 - Improve error message for cta-verify-file whn VID does not exist - cta/CTA#230 - Modify CTA code to enforce VID uppercase - cta/CTA#239 - Add improvments to the cta-change-storage-class tool +- cta/CTA#248 - Clean up output from cta-readtp ### Bug Fixes - cta/CTA#234 - Replace stoi with toUint64 in standalone cli tool - cta/CTA#238 - Compilation fails when using cta::common::Configuration::getConfEntInt(...) diff --git a/tapeserver/readtp/ReadtpCmdMain.cpp b/tapeserver/readtp/ReadtpCmdMain.cpp index a6facb6732ac0c5be9e46c43afe0fcd249c7bdfb..d34ae19b10f4c5ca3a3f51c1bfc18487aea18792 100644 --- a/tapeserver/readtp/ReadtpCmdMain.cpp +++ b/tapeserver/readtp/ReadtpCmdMain.cpp @@ -17,6 +17,7 @@ #include <iostream> +#include "common/exception/Exception.hpp" #include "tapeserver/castor/tape/tapeserver/daemon/EncryptionControl.hpp" #include "tapeserver/daemon/TapedConfiguration.hpp" #include "tapeserver/readtp/ReadtpCmd.hpp" @@ -46,16 +47,14 @@ int main(const int argc, char *const *const argv) { try { // Config file needed to find the cta-get-encryption-key script const cta::tape::daemon::TapedConfiguration tapedConfig = - cta::tape::daemon::TapedConfiguration::createFromCtaConf(DAEMON_CONFIG, log); + cta::tape::daemon::TapedConfiguration::createFromCtaConf(DAEMON_CONFIG, dummyLog); externalEncryptionKeyScript = tapedConfig.externalEncryptionKeyScript.value(); - useEncryption = tapedConfig.useEncryption.value() == "yes" ? true : false; - } - catch(...) { - cta::exception::Exception ex; - ex.getMessage() << "ReadtpCmd: Error while trying to read TapedConfiguration config file: " << DAEMON_CONFIG; - throw ex; - } + useEncryption = tapedConfig.useEncryption.value() == "yes"; - cta::tapeserver::readtp::ReadtpCmd cmd(std::cin, std::cout, std::cerr, log, dummyLog, mc, useEncryption, externalEncryptionKeyScript); - return cmd.main(argc, argv); + cta::tapeserver::readtp::ReadtpCmd cmd(std::cin, std::cout, std::cerr, log, dummyLog, mc, useEncryption, externalEncryptionKeyScript); + return cmd.main(argc, argv); + } catch(cta::exception::Exception &ex) { + std::cerr << ex.getMessageValue() << std::endl; + return 1; + } } \ No newline at end of file