lib/nanoc/cli/error_handler.rb in nanoc-3.6.9 vs lib/nanoc/cli/error_handler.rb in nanoc-3.6.10

- old
+ new

@@ -56,15 +56,19 @@ Signal.trap(signal) do puts exit!(0) end end - begin - Signal.trap('USR1') do - puts 'Caught USR1; dumping a stack trace' - puts caller.map { |i| " #{i}" }.join("\n") + + # Set stack trace dump handler + if !defined?(RUBY_ENGINE) || RUBY_ENGINE != 'jruby' + begin + Signal.trap('USR1') do + puts 'Caught USR1; dumping a stack trace' + puts caller.map { |i| " #{i}" }.join("\n") + end + rescue ArgumentError end - rescue ArgumentError end # Run yield rescue Nanoc::Errors::GenericTrivial => e