From 317071dfee553b564a760876775b16233fab044f Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Tue, 21 May 2024 11:35:38 +0200 Subject: [PATCH] chore: updates agent error response --- docs/CHANGELOG.md | 4 ++ package-lock.json | 55 +++++++++++++------------- packages/agent/src/agent/http/index.ts | 2 +- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 75facd80d..da888bef1 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed + +- chore: updates agent error response to read "Gateway returns error" instead of "Server"` + ## [1.3.0] - 2024-05-01 ### Added diff --git a/package-lock.json b/package-lock.json index 4df052acd..10abd6e7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,11 +62,11 @@ }, "e2e/browser": { "name": "@do-not-publish/ic-cypress-e2e-tests", - "version": "1.2.1", + "version": "1.3.0", "dependencies": { - "@dfinity/agent": "^1.2.1", - "@dfinity/identity": "^1.2.1", - "@dfinity/principal": "^1.2.1", + "@dfinity/agent": "^1.3.0", + "@dfinity/identity": "^1.3.0", + "@dfinity/principal": "^1.3.0", "idb-keyval": "^6.2.0" }, "devDependencies": { @@ -173,12 +173,12 @@ }, "e2e/node": { "name": "@do-not-publish/ic-node-e2e-tests", - "version": "1.2.1", + "version": "1.3.0", "dependencies": { - "@dfinity/agent": "^1.2.1", - "@dfinity/assets": "^1.2.1", - "@dfinity/identity": "^1.2.1", - "@dfinity/principal": "^1.2.1", + "@dfinity/agent": "^1.3.0", + "@dfinity/assets": "^1.3.0", + "@dfinity/identity": "^1.3.0", + "@dfinity/principal": "^1.3.0", "whatwg-fetch": "^3.6.2" }, "devDependencies": { @@ -15901,6 +15901,7 @@ "node_modules/pkcs11js": { "version": "2.1.0", "dev": true, + "hasInstallScript": true, "license": "MIT", "engines": { "node": ">=18.0.0" @@ -20683,7 +20684,7 @@ }, "packages/agent": { "name": "@dfinity/agent", - "version": "1.2.1", + "version": "1.3.0", "license": "Apache-2.0", "dependencies": { "@noble/curves": "^1.4.0", @@ -20710,8 +20711,8 @@ "whatwg-fetch": "^3.0.0" }, "peerDependencies": { - "@dfinity/candid": "^1.2.1", - "@dfinity/principal": "^1.2.1" + "@dfinity/candid": "^1.3.0", + "@dfinity/principal": "^1.3.0" } }, "packages/agent/node_modules/@esbuild/android-arm": { @@ -21039,7 +21040,7 @@ }, "packages/assets": { "name": "@dfinity/assets", - "version": "1.2.1", + "version": "1.3.0", "license": "Apache-2.0", "dependencies": { "base64-arraybuffer": "^1.0.2", @@ -21059,8 +21060,8 @@ "typedoc": "^0.22.11" }, "peerDependencies": { - "@dfinity/agent": "^1.2.1", - "@dfinity/principal": "^1.2.1", + "@dfinity/agent": "^1.3.0", + "@dfinity/principal": "^1.3.0", "@noble/hashes": "^1.3.1" } }, @@ -21396,7 +21397,7 @@ }, "packages/auth-client": { "name": "@dfinity/auth-client", - "version": "1.2.1", + "version": "1.3.0", "license": "Apache-2.0", "dependencies": { "idb": "^7.0.2" @@ -21419,9 +21420,9 @@ "whatwg-fetch": "^3.0.0" }, "peerDependencies": { - "@dfinity/agent": "^1.2.1", - "@dfinity/identity": "^1.2.1", - "@dfinity/principal": "^1.2.1" + "@dfinity/agent": "^1.3.0", + "@dfinity/identity": "^1.3.0", + "@dfinity/principal": "^1.3.0" } }, "packages/auth-client/node_modules/@esbuild/android-arm": { @@ -21749,7 +21750,7 @@ }, "packages/candid": { "name": "@dfinity/candid", - "version": "1.2.1", + "version": "1.3.0", "license": "Apache-2.0", "devDependencies": { "@types/jest": "^29.5.5", @@ -21767,7 +21768,7 @@ "whatwg-fetch": "^3.0.0" }, "peerDependencies": { - "@dfinity/principal": "^1.2.1" + "@dfinity/principal": "^1.3.0" } }, "packages/candid/node_modules/@esbuild/android-arm": { @@ -22154,7 +22155,7 @@ }, "packages/identity": { "name": "@dfinity/identity", - "version": "1.2.1", + "version": "1.3.0", "license": "Apache-2.0", "dependencies": { "@noble/curves": "^1.2.0", @@ -22175,17 +22176,17 @@ "whatwg-fetch": "^3.0.0" }, "peerDependencies": { - "@dfinity/agent": "^1.2.1", - "@dfinity/principal": "^1.2.1", + "@dfinity/agent": "^1.3.0", + "@dfinity/principal": "^1.3.0", "@peculiar/webcrypto": "^1.4.0" } }, "packages/identity-secp256k1": { "name": "@dfinity/identity-secp256k1", - "version": "1.2.1", + "version": "1.3.0", "license": "Apache-2.0", "dependencies": { - "@dfinity/agent": "^1.2.1", + "@dfinity/agent": "^1.3.0", "@noble/curves": "^1.4.0", "@noble/hashes": "^1.3.1", "asn1js": "^3.0.5", @@ -22523,7 +22524,7 @@ }, "packages/principal": { "name": "@dfinity/principal", - "version": "1.2.1", + "version": "1.3.0", "license": "Apache-2.0", "dependencies": { "@noble/hashes": "^1.3.1" diff --git a/packages/agent/src/agent/http/index.ts b/packages/agent/src/agent/http/index.ts index 970f21cc0..308ca82da 100644 --- a/packages/agent/src/agent/http/index.ts +++ b/packages/agent/src/agent/http/index.ts @@ -502,7 +502,7 @@ export class HttpAgent implements Agent { }; } else { throw new AgentHTTPResponseError( - `Server returned an error:\n` + + `Gateway returned an error:\n` + ` Code: ${fetchResponse.status} (${fetchResponse.statusText})\n` + ` Body: ${await fetchResponse.text()}\n`, {