Sha256: b19d66bdaddf1b726e7dbde1b496705999b0afa46b32035fd58a16d2b6dc417a

Contents?: true

Size: 632 Bytes

Versions: 8

Compression:

Stored size: 632 Bytes

Contents

class ApplicationError < StandardError

  attr_reader :tags, :data


  def initialize(subject, tags = '', data = {})
    super(subject)
    @tags = tags
    @data = data

    puts "#{'-'*10}\n#{@data}\n#{'-'*10}" if Rails.env.development?

    Log.on_raise(self, caller(2))
  end


  # для логирования при бросании и в дефолтном обработчике
  def with_log?
    self.class.name.end_with?('Log', 'Alert')
  end


  # для логирования при бросании и в дефолтном обработчике
  def with_alert?
    self.class.name.end_with?('Alert')
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tracer_client-0.3.0 lib/tracer_client/errors/application_error.rb
tracer_client-0.2.1 lib/tracer_client/errors/application_error.rb
tracer_client-0.1.5 lib/tracer_client/errors/application_error.rb
tracer_client-0.1.4 lib/tracer_client/errors/application_error.rb
tracer_client-0.1.3 lib/tracer_client/errors/application_error.rb
tracer_client-0.1.2 lib/tracer_client/errors/application_error.rb
tracer_client-0.1.1 lib/tracer_client/errors/application_error.rb
tracer_client-0.1.0 lib/tracer_client/errors/application_error.rb