From 7b70ab961b30c5d0124f41b3bc91061bc8bfa87c Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 30 Dec 2024 13:58:55 +1300 Subject: [PATCH] catch prettier errors (#214) --- src/DocsLookup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DocsLookup.ts b/src/DocsLookup.ts index ccd02d7..4c68b98 100644 --- a/src/DocsLookup.ts +++ b/src/DocsLookup.ts @@ -265,12 +265,12 @@ class DocEntry extends Schema.Class("DocEntry")({ // prettier const prettify = (code: string) => - Effect.promise(() => + Effect.tryPromise(() => Prettier.format(code, { parser: "typescript", semi: false, }), - ) + ).pipe(Effect.orElseSucceed(() => code)) // errors