https://github.com/restaurant-cheetah/fuli
Respond to application errors with configurable notifiers
https://github.com/restaurant-cheetah/fuli
configurable-notifiers error-handling error-notifier fuli ruby
Last synced: 9 months ago
JSON representation
Respond to application errors with configurable notifiers
- Host: GitHub
- URL: https://github.com/restaurant-cheetah/fuli
- Owner: restaurant-cheetah
- License: mit
- Created: 2019-07-17T12:21:51.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-03-02T17:14:42.000Z (over 6 years ago)
- Last Synced: 2025-04-23T05:58:09.175Z (about 1 year ago)
- Topics: configurable-notifiers, error-handling, error-notifier, fuli, ruby
- Language: Ruby
- Size: 18.6 KB
- Stars: 5
- Watchers: 13
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fuli
Respond to application errors with configurable notifiers
[](https://badge.fury.io/rb/fuli_the_guard)
### Install
```ruby
gem install fuli_the_guard
```
### Configuration
```ruby
# Notifier could be any callable object that gets error param
Fuli.configure do |config|
config.logger = YourLogger
config.warn_notifiers = [
->(error, message){ do_something_with(error, message) }]
config.error_notifiers = [
proc { |error, message| do_something_with(error, message) }]
end
# Or using class instead of proc / lambda
class SomeNotifier
class << self
def call(error, message)
# notify some service
end
end
end
Fuli.configure do |config|
config.logger = YourLogger
config.warn_notifiers = [SomeNotifier]
end
```
### Example
```ruby
class Cheetah
def hunt_em
# do things
rescue => e
context_message = { custom: 'context', more: :things }
Fuli.notify_error(e, context_message)
end
def follow_em
# do more things
warn_message = 'May be something gonna brake..'
Fuli.notify_warning(warn_message)
end
end