`catchAllDefect` not capturing exception details

Does anyone know why catchAllDefect doesn't seem to actually catch exception information? Consider this:

async function testPromiseThrow() {
  throw new Error("test");
}
const testEff = Effect.promise(() => testPromiseThrow()).pipe(
  Effect.catchAllDefect((defect) => Console.log(JSON.stringify(defect)))
);

Effect.runPromise(testEff).then();

// output: {}
Was this page helpful?