diff options
author | Neil Moore <neil@s-z.org> | 2012-04-06 10:21:00 -0500 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-04-06 10:21:00 -0500 |
commit | 5256de40f8c331c5faed104c0c0da391c70656b9 (patch) | |
tree | 28ed6a6786a424b9306cd26a982c3b083535b69b /lib/Crawl/Bot/Plugin/Monster.pm | |
parent | e0f37c7d56edafcd0ec3aa064fdf2cea95d77ef9 (diff) | |
download | crawlbot-5256de40f8c331c5faed104c0c0da391c70656b9.tar.gz crawlbot-5256de40f8c331c5faed104c0c0da391c70656b9.zip |
Capture and output monster's stderr as well.
This should make it easier to identify bugs in monster.
Diffstat (limited to 'lib/Crawl/Bot/Plugin/Monster.pm')
-rw-r--r-- | lib/Crawl/Bot/Plugin/Monster.pm | 7 |
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); |