fuli
Respond to application errors with configurable notifiers
Install
gem install fuli_the_guard
Configuration
# Notifier could be any callable object that gets error param
Fuli.configure do |config|
config.logger = YourLogger
config.warn_notifiers = [
->(error, ){ do_something_with(error, ) }]
config.error_notifiers = [
proc { |error, | do_something_with(error, ) }]
end
# Or using class instead of proc / lambda
class SomeNotifier
class << self
def call(error, )
# notify some service
end
end
end
Fuli.configure do |config|
config.logger = YourLogger
config.warn_notifiers = [SomeNotifier]
end
Example
class Cheetah
def hunt_em
# do things
rescue => e
= { custom: 'context', more: :things }
Fuli.notify_error(e, )
end
def follow_em
# do more things
= 'May be something gonna brake..'
Fuli.notify_warning()
end
end