Sha256: 7bee2de966d64a49f0523307115ec646cf1e178594d8f2011d72c03e5f8d280b

Contents?: true

Size: 497 Bytes

Versions: 10

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

require 'active_support/concern'
require 'active_support/core_ext/module/delegation.rb'

module ExceptionHandling
  module LoggingMethods # included on models and controllers
    extend ActiveSupport::Concern

    protected

    delegate :log_error_rack, :log_warning, :log_info, :log_debug, :log_error, to: ExceptionHandling

    def ensure_safe(exception_context = "")
      yield
    rescue => ex
      log_error ex, exception_context
      nil
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
exception_handling-3.1.1 lib/exception_handling/logging_methods.rb
exception_handling-3.1.1.pre.tstarck.1 lib/exception_handling/logging_methods.rb
exception_handling-3.1.0 lib/exception_handling/logging_methods.rb
exception_handling-3.1.0.pre.3 lib/exception_handling/logging_methods.rb
exception_handling-3.0.1 lib/exception_handling/logging_methods.rb
exception_handling-3.1.0.pre.2 lib/exception_handling/logging_methods.rb
exception_handling-3.1.0.pre.tstarck.2 lib/exception_handling/logging_methods.rb
exception_handling-3.1.0.pre.tstarck.1 lib/exception_handling/logging_methods.rb
exception_handling-3.0.0 lib/exception_handling/logging_methods.rb
exception_handling-3.0.0.pre.2 lib/exception_handling/logging_methods.rb