lib/ztk/base.rb
# Logs an exception and then raises it.
#
# @param [Logger] logger An instance of a class based off the Ruby
#   *Logger* class.
# @param [Exception] exception The exception class to raise.
# @param [String] message The message to display with the exception.
# @param [Integer] shift (1) How many places to shift the caller stack in
#   the log statement.
Logs an exception and then raises it.
Logs an exception and then raises it .
def log_and_raise(logger, exception, message, shift=1)
        if logger.is_a?(ZTK::Logger)
          logger.shift(:fatal, shift) { "EXCEPTION: #{exception.inspect} - #{message.inspect}" }
        else
          logger.fatal { "EXCEPTION: #{exception.inspect} - #{message.inspect}" }
        end
        raise exception, message
      end
def log_and_raise ( logger , exception , message , shift = 1 ) if logger . is_a? ( ZTK :: Logger ) logger . shift ( :fatal , shift ) { "EXCEPTION: #{exception.inspect} - #{message.inspect}" } else logger . fatal { "EXCEPTION: #{exception.inspect} - #{message.inspect}" } end raise exception , message end
Logs an exception and then raises it.
Logs an exception and then raises it .
logger
<not_specific>
exception
<not_specific>
message
<not_specific>
shift
<not_specific>
<not_specific>
shift (1) How many places to shift the caller stack in the log statement.
shift ( 1 ) How many places to shift the caller stack in the log statement .