diff options
author | Elizabeth <me@liz.coffee> | 2025-06-02 16:52:52 -0700 |
---|---|---|
committer | Elizabeth <me@liz.coffee> | 2025-06-02 16:52:52 -0700 |
commit | 98f5c21aa65bbbca01a186a754249335b4afef57 (patch) | |
tree | 0fc8e01a73f0a3be4534c11724ad2ff634b4fd2f /worker/jobs | |
parent | 373d9ec700c0097a22cf665a8e33cf48998d1dc2 (diff) | |
download | ci-98f5c21aa65bbbca01a186a754249335b4afef57.tar.gz ci-98f5c21aa65bbbca01a186a754249335b4afef57.zip |
fixup the Either monad a bit for type safetyp
Diffstat (limited to 'worker/jobs')
-rw-r--r-- | worker/jobs/ci_pipeline.run | 6 |
1 files changed, 3 insertions, 3 deletions
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 }); }) ); |