Sha256: 64b68974b176cb33dde07e5d30fd4fe6c883d9c5ebdfcfd0f6ffb9224b48db22

Contents?: true

Size: 415 Bytes

Versions: 1

Compression:

Stored size: 415 Bytes

Contents

require "active_error/version"

module ActiveError
  def self.new(error_class_or_message = nil, message = nil, backtrace: caller)
    if error_class_or_message.is_a? Class
      error_class = error_class_or_message
    else
      error_class = StandardError
      message = error_class_or_message.to_s
    end

    exception = error_class.new(message)
    exception.set_backtrace(backtrace)
    exception
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_error-1.0.1 lib/active_error.rb