FileSaver: count how many files failed, Commands: Show how many failed

This commit is contained in:
2019-04-26 22:46:33 +02:00
parent 098cd96dd2
commit 7df1ddf891
4 changed files with 21 additions and 15 deletions

View File

@@ -51,9 +51,12 @@ int CommandAdd::handle(QStringList arguments)
}
FileSaver saver(*this->dbService);
if(!saver.addFiles(files.toVector(), keepGoing, verbose))
int numFilesCount = files.size();
int processedFilesCount = saver.addFiles(files.toVector(), keepGoing, verbose);
if(processedFilesCount != numFilesCount)
{
Logger::error() << "Errors occured while trying to add files to the database" << endl;
Logger::error() << "Errors occured while trying to add files to the database. Processed " << processedFilesCount
<< "out of" << numFilesCount << "files" << endl;
return 1;
}