Class: RailsErrorDashboard::ManualErrorReporter::SyntheticException Private
- Inherits:
-
Object
- Object
- RailsErrorDashboard::ManualErrorReporter::SyntheticException
- Defined in:
- lib/rails_error_dashboard/manual_error_reporter.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
SyntheticException: A fake exception object for manual error reporting
This class mimics a Ruby Exception to work with the existing LogError command, but represents errors from non-Ruby sources (frontend, mobile, etc.)
Defined Under Namespace
Classes: MockClass
Instance Attribute Summary collapse
- #backtrace ⇒ Object readonly private
- #message ⇒ Object readonly private
Instance Method Summary collapse
-
#class ⇒ Object
private
Returns a mock class object that represents the error type.
-
#initialize(error_type:, message:, backtrace:) ⇒ SyntheticException
constructor
private
A new instance of SyntheticException.
-
#inspect ⇒ String
private
Inspect for debugging.
-
#is_a?(klass) ⇒ Boolean
private
Check if this is a specific error type.
Constructor Details
#initialize(error_type:, message:, backtrace:) ⇒ SyntheticException
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SyntheticException.
133 134 135 136 137 |
# File 'lib/rails_error_dashboard/manual_error_reporter.rb', line 133 def initialize(error_type:, message:, backtrace:) @error_type = error_type @message = @backtrace = backtrace end |
Instance Attribute Details
#backtrace ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
128 129 130 |
# File 'lib/rails_error_dashboard/manual_error_reporter.rb', line 128 def backtrace @backtrace end |
#message ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
128 129 130 |
# File 'lib/rails_error_dashboard/manual_error_reporter.rb', line 128 def @message end |
Instance Method Details
#class ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a mock class object that represents the error type
141 142 143 144 145 |
# File 'lib/rails_error_dashboard/manual_error_reporter.rb', line 141 def class # Return a simple object that quacks like a class # This allows the error type to be stored correctly in the database @class ||= MockClass.new(@error_type) end |
#inspect ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Inspect for debugging
175 176 177 |
# File 'lib/rails_error_dashboard/manual_error_reporter.rb', line 175 def inspect "#<#{@error_type}: #{@message}>" end |
#is_a?(klass) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Check if this is a specific error type
166 167 168 169 170 171 |
# File 'lib/rails_error_dashboard/manual_error_reporter.rb', line 166 def is_a?(klass) return true if klass == self.class return true if klass == SyntheticException return true if klass.to_s == @error_type false end |