From 05f9da57f68bad58c06224d00ea3f9b51f2888d6 Mon Sep 17 00:00:00 2001 From: HardlyDifficult Date: Thu, 19 Mar 2026 15:03:57 -0400 Subject: [PATCH] fix(http): include request method and URL on ApiError from Axios Append [request: METHOD url] when error.config is present to ease debugging proxy/404 mismatches. Bump to 0.0.192 for release. --- package.json | 2 +- src/core/http/HttpClient.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 019a7ad6..22d0e894 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fairmint/canton-node-sdk", - "version": "0.0.127", + "version": "0.0.192", "description": "Canton Node SDK", "keywords": [ "canton", diff --git a/src/core/http/HttpClient.ts b/src/core/http/HttpClient.ts index 39e1355f..75b6399d 100644 --- a/src/core/http/HttpClient.ts +++ b/src/core/http/HttpClient.ts @@ -218,6 +218,11 @@ export class HttpClient { } } + // Non-standard bodies (e.g. reverse-proxy "404 page not found") rarely include Canton fields; the URL is the best repro hint. + if (error.config?.url) { + msg += ` [request: ${error.config.method ?? 'GET'} ${error.config.url}]`; + } + return new ApiError(msg, status, error.response?.statusText, data); } return new NetworkError(`Request failed: ${error instanceof Error ? error.message : String(error)}`);