From b4dc1ddbf31709ff25c08559540f4c6c74100896 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 26 Aug 2009 01:06:33 +0100 Subject: [PATCH] Report glpsol errors much better --- yarrg/web/routetrade | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index b394a35..6fe34fe 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -410,7 +410,9 @@ if ($qa->{'debug'}) { qw(glpsol --cpxlp /dev/stdin -o /dev/stdout)); print "
\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 "
\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( -- 2.30.2