Codibre/fluent-iterable

View on GitHub
src/sync/catch.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { CatchCallback } from '../types';
export function* catchSync<T>(this: Iterable<T>, errorCallback: CatchCallback) {
  try {
    yield* this;
  } catch (err) {
    errorCallback(err);
  }
}