lib/rabbit/console.rb in rabbit-2.2.1 vs lib/rabbit/console.rb in rabbit-3.0.0
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (C) 2005-2012 Kouhei Sutou <kou@cozmixng.org>
+# Copyright (C) 2005-2017 Kouhei Sutou <kou@cozmixng.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@@ -16,10 +16,12 @@
require 'English'
require "shellwords"
require "optparse"
+require "optparse/date"
+require "optparse/time"
require "ostruct"
require "uri"
require "pathname"
require "rabbit/rabbit"
@@ -77,11 +79,15 @@
end
options.rest.concat(parser.parse!(args))
options.after_hooks.each do |hook|
hook.call(self, parser, options)
end
- rescue
- @logger.fatal($!.message)
+ rescue => error
+ @logger.error("#{error.class}: #{error.message}")
+ error.backtrace.each do |line|
+ @logger.error(line)
+ end
+ raise
end
[options, options.logger]
end