/** * Recovers from specified error. * * @tsplus static effect/core/stm/STM.Aspects catch * @tsplus pipeable effect/core/stm/STM catch */ export function _catch( tag: N, k: K, f: (e: Extract) => STM ) { return ( self: STM ): STM | E1, A | A1> => self.catchAll((e) => { if (typeof e === "object" && e != null && tag in e && e[tag] === k) { return f(e as any) } return STM.fail(() => e) }) } export { _catch as catch }