How to use the opossum.isOurError function in opossum

To help you get started, we’ve selected a few opossum examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / opossum / opossum-tests.ts View on Github external
import * as fs from 'fs';
import * as CircuitBreaker from 'opossum';
import { promisify } from 'util';

let breaker: CircuitBreaker;
const callbackNoArgs = async () => console.log('foo');

CircuitBreaker.isOurError(new Error()); // $ExpectType boolean

breaker = new CircuitBreaker(async () => true, {
    timeout: 1000,
    maxFailures: 50,
    resetTimeout: 10,
    rollingCountTimeout: 500,
    rollingCountBuckets: 20,
    name: 'test',
    group: 'group',
    rollingPercentilesEnabled: true,
    capacity: 1,
    errorThresholdPercentage: 1,
    enabled: true,
    allowWarmUp: true,
    volumeThreshold: 1,
    cache: true,

opossum

A fail-fast circuit breaker for promises and callbacks

Apache-2.0
Latest version published 11 days ago

Package Health Score

92 / 100
Full package analysis

Popular opossum functions