From 5256de40f8c331c5faed104c0c0da391c70656b9 Mon Sep 17 00:00:00 2001 From: Neil Moore Date: Fri, 6 Apr 2012 10:21:00 -0500 Subject: Capture and output monster's stderr as well. This should make it easier to identify bugs in monster. --- lib/Crawl/Bot/Plugin/Monster.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 = ; CORE::close(F); -- cgit v1.2.3-54-g00ecf