From 98f5c21aa65bbbca01a186a754249335b4afef57 Mon Sep 17 00:00:00 2001 From: Elizabeth Date: Mon, 2 Jun 2025 16:52:52 -0700 Subject: fixup the Either monad a bit for type safetyp --- worker/jobs/ci_pipeline.run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'worker/jobs') diff --git a/worker/jobs/ci_pipeline.run b/worker/jobs/ci_pipeline.run index 434850c..03d9d6d 100644 --- a/worker/jobs/ci_pipeline.run +++ b/worker/jobs/ci_pipeline.run @@ -123,9 +123,9 @@ await LogMetricTraceable.from(eitherJob).bimap(TraceUtil.withTrace(trace)) ) .get() .then((e) => - e.flatMap(() => eitherJob).fold((err, val) => { - if (!val || err) throw err; - return Deno.remove(getWorkingDirectoryForCiJob(val), { recursive: true }); + e.flatMap(() => eitherJob).fold(({isLeft, isRight, value}) => { + if (isLeft || !isRight) throw value; + return Deno.remove(getWorkingDirectoryForCiJob(value), { recursive: true }); }) ); -- cgit v1.2.3-70-g09d2