const responseAsEither = yield* pipe(
Match.value(response),
Match.when(Schema.is(resultSchema), Either.right),
Match.when(Schema.is(errorSchema), (error) => Either.left(error)),
Match.exhaustive,
);
return responseAsEither;
const responseAsEither = yield* pipe(
Match.value(response),
Match.when(Schema.is(resultSchema), Either.right),
Match.when(Schema.is(errorSchema), (error) => Either.left(error)),
Match.exhaustive,
);
return responseAsEither;