Skip to content

Commit 58898f5

Browse files
refactor(gitcafe): catch only forbidden reviewer errors with catchIf
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3a2253c commit 58898f5

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

‎packages/source-control-gitcafe/src/server/GitCafePullRequestProvider.ts‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,14 @@ export const make = Effect.gen(function* () {
273273
(operation: string) =>
274274
<A, R>(effect: Effect.Effect<A, PullRequestProviderError, R>) =>
275275
effect.pipe(
276-
Effect.catch((error) =>
277-
isForbidden(error)
278-
? Effect.fail(
279-
failure(
280-
operation,
281-
"This GitCafe token cannot request reviewers. It needs the pr:review:read and pr:reviewers:write scopes.",
282-
error,
283-
),
284-
)
285-
: Effect.fail(error),
276+
Effect.catchIf(isForbidden, (error) =>
277+
Effect.fail(
278+
failure(
279+
operation,
280+
"This GitCafe token cannot request reviewers. It needs the pr:review:read and pr:reviewers:write scopes.",
281+
error,
282+
),
283+
),
286284
),
287285
);
288286

0 commit comments

Comments
 (0)