From: Chris Duncan Date: Wed, 5 Aug 2026 03:34:53 +0000 (-0700) Subject: Simplify RPC error logging. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=29a80b5a1db00b036281b738f04dbda11d7832a4;p=libnemo.git Simplify RPC error logging. --- diff --git a/src/lib/rpc/index.ts b/src/lib/rpc/index.ts index fe3f3c2..ddf82f6 100644 --- a/src/lib/rpc/index.ts +++ b/src/lib/rpc/index.ts @@ -70,7 +70,8 @@ export class Rpc { const status = res.status const statusText = res.statusText ? ` ${res.statusText}` : '' if (status !== 200) { - throw new Error(`${status} ${statusText}`, { cause: JSON.stringify(res) }) + const msg = `${status}${statusText}` + throw new Error(msg, { cause: msg }) } const resBody = await res.json() const code = resBody.code ? `${resBody.code} ` : ''