{:ok, %{status: status}} when status in [428, 500, 504] -> true
{:ok, _} -> false
{:error, _} -> true
end
end
```
## Options
- `:name` - fuse name (defaults to module name)
- `:opts` - fuse options (see fuse docs for reference)
+ - `:keep_orig_error` - boolean to indicate if, in case of melting (based on `should_melt`), it should return the upstream's error or the fixed one `{:error, unavailable}`.
+ It's false by default, but it will be true in `2.0.0` version
- `:should_melt` - function to determine if response should melt the fuse
## SASL logger
fuse library uses [SASL (System Architecture Support Libraries)](http://erlang.org/doc/man/sasl_app.html).
You can disable its logger output using:
```
config :sasl, sasl_error_logger: :false
```
Read more at [jlouis/fuse#32](https://github.com/jlouis/fuse/issues/32) and [jlouis/fuse#19](https://github.com/jlouis/fuse/issues/19).
"""
@behaviour Tesla.Middleware
# options borrowed from http://blog.rokkincat.com/circuit-breakers-in-elixir/