# Failsafe Adapter

> Wraps another adapter and fails safely when an exception is raised. This prevents issues like network hiccups from taking down an application using Flipper.

## Installation

This adapter is included with the `flipper` gem.

## Usage

```ruby
Flipper.configure do |config|
  config.use Flipper::Adapters::Failsafe,
    errors: [Redis::ConnectionError, Redis::TimeoutError]
  config.adapter do
    Flipper::Adapters::Redis.new(Redis.new)
  end
end
```

The `errors` option defaults to `[StandardError]`, which will rescue any exception raised. It is recommended to set it to specific errors that you anticipate could take down your application.

**Warning**: This adapter will silently swallow the errors that it encounters, including those encountered while updating features (like `Flipper.enable :my_feature`). You will likely want some other health check in place to notify you of issues.
