Skip to content
Snippets Groups Projects
Commit fd9f6222 authored by Michael Davis's avatar Michael Davis
Browse files

[cta-admin] Gives a better error when cta.endpoint is not specified

parent 07e65f5b
No related branches found
No related tags found
No related merge requests found
......@@ -147,7 +147,8 @@ void CtaAdminCmd::send() const
}
// Set configuration options
XrdSsiPb::Config config("/etc/cta/cta-cli.conf", "cta");
const std::string config_file = "/etc/cta/cta-cli.conf";
XrdSsiPb::Config config(config_file, "cta");
config.set("resource", "/ctafrontend");
config.set("response_bufsize", StreamBufferSize); // default value = 1024 bytes
config.set("request_timeout", DefaultRequestTimeout); // default value = 10s
......@@ -162,6 +163,12 @@ void CtaAdminCmd::send() const
// If fine-grained control over log level is required, use XrdSsiPbLogLevel
config.getEnv("log", "XrdSsiPbLogLevel");
// Validate that endpoint was specified in the config file
if(!config.getOptionValueStr("endpoint").first) {
throw std::runtime_error("Configuration error: cta.endpoint missing from " + config_file);
}
// Obtain a Service Provider
XrdSsiPbServiceType cta_service(config);
......
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