Using runPromise throws FiberFailure
why is the error not an instance of
BadRequestException and how to tackle this ?BadRequestExceptionasync create(@Body() createArticleDto: CreateArticleDto) {
const program = pipe(
createArticleDto,
dtoToEntity,
createOne,
Effect.catchAll(() => Effect.fail(new BadRequestException())),
);
try {
await this.runtime.runPromise(program);
} catch (err: any) {
console.log(err.name); // BadRequestException
const isBadRequest = err instanceof BadRequestException; // false
}
}