From 67afddc32a3761b52c348c8edc55fba6d1ae7611 Mon Sep 17 00:00:00 2001 From: uu59 Date: Wed, 28 Jan 2015 18:10:38 +0900 Subject: [PATCH] Add debug info on Circle CI failed --- app/models/fluent_gem.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/fluent_gem.rb b/app/models/fluent_gem.rb index b48b5a5..09e6cb6 100644 --- a/app/models/fluent_gem.rb +++ b/app/models/fluent_gem.rb @@ -17,9 +17,9 @@ module FluentGem # but long living caching causes mismatch with actual status e.g. user install plugin from console (without fluentd-ui) # So our decision is that cache `gem list` in 3 seconds Rails.cache.fetch(LIST_CACHE_KEY, expires_in: 3.seconds) do - output = `#{gem} list` + output = `#{gem} list 2>&1` if $? && $?.exitstatus != 0 # NOTE: $? will be nil on CircleCI, so check $? at first - raise GemError, "failed command: `#{gem} list`" + raise GemError, "failed command: `#{gem} list` output: #{output}" end output.lines.to_a end