@@ -76,6 +76,7 @@ int main(int argc, char** argv)
7676 std::cerr << e.what () << " , application will now exit" << std::endl;
7777 exit (2 );
7878 }
79+ int ret = 0 ;
7980 std::string action = vm[" action" ].as <std::string>();
8081 std::vector<int64_t > vect;
8182 std::string ccdbPath;
@@ -120,10 +121,10 @@ int main(int argc, char** argv)
120121 int64_t runnum = vm[" run-number" ].as <int64_t >();
121122 metadata[" runNumber" ] = std::to_string (runnum);
122123 std::cout << " Storing:" << ccdbPath << " " << metadata[" runNumber" ] << " tmin:" << tmin << " tmax:" << tmax << " ts:" << tt << std::endl;
123- api.storeAsTFileAny (&(vect), ccdbPath, metadata, tmin, tmax);
124+ ret = api.storeAsTFileAny (&(vect), ccdbPath, metadata, tmin, tmax);
124125 } else {
125126 std::cout << " Storing:" << ccdbPath << " tmin:" << tmin << " tmax:" << tmax << " ts:" << tt << std::endl;
126- api.storeAsTFileAny (&(vect), ccdbPath, metadata, tmin, tmax);
127+ ret = api.storeAsTFileAny (&(vect), ccdbPath, metadata, tmin, tmax);
127128 }
128129 }
129130 //
@@ -132,7 +133,7 @@ int main(int argc, char** argv)
132133 TFile* f = TFile::Open (file.c_str (), " RECREATE" );
133134 if (f == nullptr ) {
134135 std::cout << " Error: File" << file << " could not be open for writing !!!" << std::endl;
135- return 1 ;
136+ ret++; ;
136137 } else {
137138 std::cout << " File" << file << " being writen." << std::endl;
138139 f->WriteObject (&vect, " ccdb_object" );
@@ -141,5 +142,5 @@ int main(int argc, char** argv)
141142 } else {
142143 std::cout << " No file created" << std::endl;
143144 }
144- return 0 ;
145+ return ret ;
145146}
0 commit comments