bin/genevalidatorapp in genevalidatorapp-1.5.3 vs bin/genevalidatorapp in genevalidatorapp-1.5.4

- old
+ new

@@ -32,10 +32,14 @@ on 'c', 'config_file=', 'Use the given configuration file', argument: true + on 'g', 'gv_public_dir=', + 'The public directory that is served to the web application.', + argument: true + on 'b', 'bin=', 'Load BLAST+ and/or MAFFT binaries from this directory', argument: true, as: Array @@ -109,63 +113,62 @@ # The aim of following error recovery scenarios is to guide user to a # working GeneValidatorApp installation. We expect to land following # error scenarios either when creating a new GeneValidatorApp (first # time or later), or updating config values using -s CLI option. - rescue GeneValidatorApp::CONFIG_FILE_ERROR, - GeneValidatorApp::BLAST_DATABASE_ERROR => e + rescue GeneValidatorApp::CONFIG_FILE_ERROR => e puts e exit! - rescue GeneValidatorApp::BIN_DIR_NOT_FOUND => e + rescue GeneValidatorApp::NUM_THREADS_INCORRECT => e puts e - unless bin? + unless num_threads? puts 'You can set the correct value by running:' puts - puts ' genevalidatorapp -s -b <value>' + puts ' genevalidatorapp -s -n <value>' puts end exit! - rescue GeneValidatorApp::DATABASE_DIR_NOT_FOUND => e + rescue GeneValidatorApp::BIN_DIR_NOT_FOUND => e puts e - unless database_dir? + unless bin? puts 'You can set the correct value by running:' puts - puts ' genevalidatorapp -s -d <value>' + puts ' genevalidatorapp -s -b <value>' puts end exit! - rescue GeneValidatorApp::NUM_THREADS_INCORRECT => e + rescue GeneValidatorApp::EXTENSION_FILE_NOT_FOUND => e puts e - unless num_threads? + unless require? puts 'You can set the correct value by running:' puts - puts ' genevalidatorapp -s -n <value>' + puts ' genevalidatorapp -s -r <value>' puts end exit! - rescue GeneValidatorApp::EXTENSION_FILE_NOT_FOUND => e + rescue GeneValidatorApp::DATABASE_DIR_NOT_FOUND => e puts e - unless require? + unless database_dir? puts 'You can set the correct value by running:' puts - puts ' genevalidatorapp -s -r <value>' + puts ' genevalidatorapp -s -d <value>' puts end exit! @@ -198,10 +201,11 @@ fetch_option(:bin).value = File.join(response) puts redo end + rescue GeneValidatorApp::DATABASE_DIR_NOT_SET => e # Show original error message. puts puts e @@ -223,19 +227,24 @@ puts response = Readline.readline('>> ').to_s.strip fetch_option(:database_dir).value = response redo - rescue GeneValidatorApp::NO_BLAST_DATABASE_FOUND => e + rescue GeneValidatorApp::NO_BLAST_DATABASE_FOUND, + GeneValidatorApp::NO_PROTEIN_BLAST_DATABASE_FOUND => e unless list_databases? - # Print error raised. puts puts e - + exit! end + rescue GeneValidatorApp::BLAST_DATABASE_ERROR => e + + puts e + exit! + rescue => e # This will catch any unhandled error and some very special errors. # Ideally we will never hit this block. If we do, there's a bug in # GeneValidatorApp or something really weird going on. If we hit this # error block we show the stacktrace to the user requesting them to @@ -248,10 +257,10 @@ https://github.com/wurmlab/genevalidatorapp/issues Error: #{e.backtrace.unshift(e.message).join("\n")} MSG - exit + exit! end if list_databases? puts GeneValidatorApp::Database.all exit