Skip to content

Commit 86ee4b5

Browse files
ScottN-PVclaude
andcommitted
fix(server): pass a hub error through readAccounts unchanged
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 05cd27a commit 86ee4b5

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎apps/server/src/usage/cliproxyApi.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ describe("CLIProxyAPI hub failures", () => {
147147
}),
148148
);
149149
const error = yield* Effect.flip(api.readAccounts(config));
150-
expect(error.detail).toContain("could not list accounts");
151150
expect(error.detail).toContain("UNABLE_TO_GET_ISSUER_CERT_LOCALLY");
152151
expect(error.detail).toContain("NODE_EXTRA_CA_CERTS");
153152
}),

‎apps/server/src/usage/cliproxyApi.ts‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,10 @@ export const makeCliproxyApi = Effect.gen(function* () {
347347
config: UsageLimitSourceConfig,
348348
): Effect.fn.Return<ReadonlyArray<UsageLimitSourceAccount>, UsageLimitSourceError> {
349349
const accounts = yield* authFiles(config).pipe(
350-
Effect.mapError(
351-
(error) =>
352-
new UsageLimitSourceError({
353-
detail: isUsageLimitSourceError(error)
354-
? `The hub could not list accounts. ${error.detail}`
355-
: "The hub could not list accounts.",
356-
}),
350+
Effect.mapError((error) =>
351+
isUsageLimitSourceError(error)
352+
? error
353+
: new UsageLimitSourceError({ detail: "The hub could not list accounts." }),
357354
),
358355
);
359356
return yield* Effect.forEach(

0 commit comments

Comments
 (0)