ExternalService.CircuitBreakerOpen exception (ExternalService v2.0.0-rc.1)

Copy Markdown View Source

Raised or returned when a call is rejected because the service's circuit breaker is open (the fuse is blown).

This is an Errata infrastructure error. The same value is returned in an {:error, error} tuple by ExternalService.call/3 and raised by ExternalService.call!/3. Its :context contains the :service (the fuse name) whose circuit breaker is open.

Summary

Functions

Returns the HTTP status code associated with this error (503 by default).

Types

Functions

http_status(error)

@spec http_status(Errata.error()) :: non_neg_integer()

Returns the HTTP status code associated with this error (503 by default).

The default is derived from the error's kind, or set via the :http_status option. Override this function to compute a status from the error's :reason or :context. See also Errata.http_status/1.