summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-04-06 10:21:00 -0500
committerNeil Moore <neil@s-z.org>2012-04-06 10:21:00 -0500
commit5256de40f8c331c5faed104c0c0da391c70656b9 (patch)
tree28ed6a6786a424b9306cd26a982c3b083535b69b
parente0f37c7d56edafcd0ec3aa064fdf2cea95d77ef9 (diff)
downloadcrawlbot-5256de40f8c331c5faed104c0c0da391c70656b9.tar.gz
crawlbot-5256de40f8c331c5faed104c0c0da391c70656b9.zip
Capture and output monster's stderr as well.
This should make it easier to identify bugs in monster.
-rw-r--r--lib/Crawl/Bot/Plugin/Monster.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Crawl/Bot/Plugin/Monster.pm b/lib/Crawl/Bot/Plugin/Monster.pm
index 0c22a25..6140c70 100644
--- a/lib/Crawl/Bot/Plugin/Monster.pm
+++ b/lib/Crawl/Bot/Plugin/Monster.pm
@@ -30,7 +30,12 @@ sub get_monster_info {
return "Error: Bad branch $branch\n" unless $branch =~ /^(trunk|stable)$/;
- CORE::open(F, "-|", "bin/monster-$branch", $monster) or return undef;
+ CORE::open(F, "-|") || do {
+ # Collect stderr too
+ close STDERR; open STDERR, '>&STDOUT';
+ exec "bin/monster-$branch", $monster or die "could not execute monster-$branch: $!";
+
+ };
local $/ = undef;
my $resp = <F>;
CORE::close(F);