Exception: ApplicationError
- Inherits:
-
StandardError
- Object
- StandardError
- ApplicationError
- Defined in:
- lib/tracer_client/errors/application_error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(subject, tags = '', data = {}) ⇒ ApplicationError
constructor
A new instance of ApplicationError.
-
#with_alert? ⇒ Boolean
для логирования при бросании и в дефолтном обработчике.
-
#with_log? ⇒ Boolean
для логирования при бросании и в дефолтном обработчике.
Constructor Details
#initialize(subject, tags = '', data = {}) ⇒ ApplicationError
Returns a new instance of ApplicationError.
6 7 8 9 10 11 12 13 14 |
# File 'lib/tracer_client/errors/application_error.rb', line 6 def initialize(subject, = '', data = {}) super(subject) = @data = data puts "#{'-'*10}\n#{@data}\n#{'-'*10}" if Rails.env.development? Log.on_raise(self, caller(2)) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/tracer_client/errors/application_error.rb', line 3 def data @data end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
3 4 5 |
# File 'lib/tracer_client/errors/application_error.rb', line 3 def end |
Instance Method Details
#with_alert? ⇒ Boolean
для логирования при бросании и в дефолтном обработчике
24 25 26 |
# File 'lib/tracer_client/errors/application_error.rb', line 24 def with_alert? self.class.name.end_with?('Alert') end |
#with_log? ⇒ Boolean
для логирования при бросании и в дефолтном обработчике
18 19 20 |
# File 'lib/tracer_client/errors/application_error.rb', line 18 def with_log? self.class.name.end_with?('Log', 'Alert') end |