chiark / gitweb /
Report glpsol errors much better
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 26 Aug 2009 00:06:33 +0000 (01:06 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 26 Aug 2009 00:06:33 +0000 (01:06 +0100)
yarrg/web/routetrade

index b394a35..6fe34fe 100644 (file)
@@ -410,7 +410,9 @@ if ($qa->{'debug'}) {
                qw(glpsol --cpxlp /dev/stdin -o /dev/stdout));
        print "<pre>\n" if $qa->{'debug'};
        my $found_section= 0;
+       my $glpsol_out= '';
        while (<$output>) {
+               $glpsol_out.= $_;
                print encode_entities($_) if $qa->{'debug'};
                if (m/^\s*No\.\s+Column name\s+St\s+Activity\s/) {
                        die if $found_section>0;
@@ -431,8 +433,9 @@ if ($qa->{'debug'}) {
                $flow->{OptCapital}= $flow->{OptQty} * $flow->{'org_price'};
        }
        print "</pre>\n" if $qa->{'debug'};
-       pipethrough_run_finish($output, 'glpsol');
-       die unless $found_section;
+       my $prerr= "\n=====\n$cplex\n=====\n$glpsol_out\n=====\n ";
+       pipethrough_run_finish($output,$prerr);
+       die $prerr unless $found_section;
 };
 
 $addcols->({ DoReverse => 1 }, qw(