Class: Hooks::Core::Failbot
- Inherits:
-
Object
- Object
- Hooks::Core::Failbot
- Defined in:
- lib/hooks/core/failbot.rb
Overview
Global failbot component for error reporting
This is a stub implementation that does nothing by default. Users can replace this with their own implementation for services like Sentry, Rollbar, etc.
Instance Method Summary collapse
-
#capture(context = {}) ⇒ Object
Capture an exception during block execution.
-
#critical(error_or_message, context = {}) ⇒ void
Report a critical error.
-
#report(error_or_message, context = {}) ⇒ void
Report an error or exception.
-
#warning(message, context = {}) ⇒ void
Report a warning.
Instance Method Details
#capture(context = {}) ⇒ Object
Capture an exception during block execution
42 43 44 45 46 47 |
# File 'lib/hooks/core/failbot.rb', line 42 def capture(context = {}) yield rescue => e report(e, context) raise end |
#critical(error_or_message, context = {}) ⇒ void
This method returns an undefined value.
Report a critical error
25 26 27 |
# File 'lib/hooks/core/failbot.rb', line 25 def critical(, context = {}) # Override in subclass for actual error reporting end |
#report(error_or_message, context = {}) ⇒ void
This method returns an undefined value.
Report an error or exception
16 17 18 |
# File 'lib/hooks/core/failbot.rb', line 16 def report(, context = {}) # Override in subclass for actual error reporting end |
#warning(message, context = {}) ⇒ void
This method returns an undefined value.
Report a warning
34 35 36 |
# File 'lib/hooks/core/failbot.rb', line 34 def warning(, context = {}) # Override in subclass for actual warning reporting end |