Commit 54356122 authored by Karl Kornel's avatar Karl Kornel
Browse files

Better checking of search output

parent 94464c19
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -731,7 +731,20 @@ EOF
    # Grab the second line.
    # Next, split the retrieved line into space-separated fields.
    # The first field is our UID.
    my ($file_uid, $file_name) = (split(/\s+/, (split(/\n/, $search_output))[1]))[0,1];
    my @search_lines = split(/\n/, $search_output);
    if (scalar(@search_lines) < 2) {
        dolog(<<"EOF");
We could not find a matching sample sheet for this library ID.
The library ID is: $library_id
Please make sure the samplesheet name starts with "$library_id SampleSheet",
and that the name ends in '.csv'.
EOF
		email_failure('Unable to find matching samplesheet', 'run',
			      $RUNFOLDER, "$RealBin/email-recipients.txt",
			      $LOGPATH, \$LOG, $RealBin, $RealScript);
        return undef;
    }
    my ($file_uid, $file_name) = (split(/\s+/, $search_lines[1]))[0,1];
    if (!defined($file_uid) or !$file_uid) {
        dolog(<<"EOF");
We could not find a matching sample sheet for this library ID.