Skip to main content

Examples

Error Boundaries

Resilient API dashboard with circuit breakers, retry strategies, and performance metrics.

Try it

Loading example…

Use the fail-rate sliders to inject errors. Watch circuit breakers open after 3 failures and auto-recover. Switch recovery strategies to see retry-later backoff in action.

How it works

Three simulated API services with configurable failure rates demonstrate Directive’s error handling primitives.

  1. Circuit Breakers – Each service has its own circuit breaker. After 3 consecutive failures the circuit opens, blocking requests. After a recovery timeout it enters half-open to test recovery.
  2. Recovery Strategies – Choose between skip (swallow errors), retry-later (exponential backoff), or throw to see how the system responds.
  3. Performance Metrics – Average latency, error rates, and request counts update in real-time.

Source code

main.ts
// Source file "main.ts" not found

Stay in the loop. Sign up for our newsletter.

We care about your data. We'll never share your email.

Powered by Directive. This signup uses a Directive module with facts, derivations, constraints, and resolvers – zero useState, zero useEffect. Read how it works