diff --git a/CHANGELOG.md b/CHANGELOG.md index 5443bd2..016a716 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 22.2.3 + +* Fixed: Verbose and report error output no longer dumps bundled source context from compiled binaries + ## 22.2.2 * Fixed: Release binaries now embed `@napi-rs/keyring` native bindings for all targets diff --git a/README.md b/README.md index 67905eb..dcec6e1 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using ```sh $ appwrite -v -22.2.2 +22.2.3 ``` ### Install using prebuilt binaries @@ -83,7 +83,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc Once the installation completes, you can verify your install using ``` $ appwrite -v -22.2.2 +22.2.3 ``` ## Getting Started diff --git a/install.ps1 b/install.ps1 index fe8a6f4..9844579 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,8 @@ # You can use "View source" of this page to see the full script. # REPO -$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.2/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.2/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.3/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.3/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index 7f535eb..81bca68 100644 --- a/install.sh +++ b/install.sh @@ -120,7 +120,7 @@ verifyMacOSCodeSignature() { downloadBinary() { echo "[2/5] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="22.2.2" + GITHUB_LATEST_VERSION="22.2.3" GITHUB_FILE="appwrite-cli-${OS}-${ARCH}" GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE" diff --git a/lib/constants.ts b/lib/constants.ts index 3a2833f..ed3d140 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,7 +1,7 @@ // SDK export const SDK_TITLE = 'Appwrite'; export const SDK_TITLE_LOWER = 'appwrite'; -export const SDK_VERSION = '22.2.2'; +export const SDK_VERSION = '22.2.3'; export const SDK_NAME = 'Command Line'; export const SDK_PLATFORM = 'console'; export const SDK_LANGUAGE = 'cli'; diff --git a/lib/parser.ts b/lib/parser.ts index 063a063..2a56f36 100644 --- a/lib/parser.ts +++ b/lib/parser.ts @@ -663,6 +663,38 @@ const printQueryErrorHint = (err: Error): void => { ); }; +const ERROR_DETAIL_KEYS = ["code", "type", "response"] as const; + +export const formatErrorForLog = (err: Error): string => { + const stack = err.stack || `${err.name}: ${err.message}`; + const detailLines = ERROR_DETAIL_KEYS.flatMap((key) => { + if (!Object.prototype.hasOwnProperty.call(err, key)) { + return []; + } + + const value = (err as unknown as Record)[key]; + let detail = "undefined"; + try { + detail = + typeof value === "string" + ? JSON.stringify(value) + : JSON.stringify(value) ?? String(value); + } catch { + detail = String(value); + } + + return [`${key}: ${detail}`]; + }); + + if (detailLines.length === 0) { + return stack; + } + + const [summary, ...frames] = stack.split("\n"); + + return [summary, ...detailLines, ...frames].join("\n"); +}; + export const parseError = (err: Error): void => { if (cliConfig.report) { void (async () => { @@ -712,12 +744,12 @@ export const parseError = (err: Error): void => { printQueryErrorHint(err); error("\n Stack Trace: \n"); - console.error(err); + console.error(formatErrorForLog(err)); process.exit(1); })(); } else { if (cliConfig.verbose) { - console.error(err); + console.error(formatErrorForLog(err)); printQueryErrorHint(err); } else { log("For detailed error pass the --verbose or --report flag"); diff --git a/package-lock.json b/package-lock.json index 601b3f5..2fe2149 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "appwrite-cli", - "version": "22.2.2", + "version": "22.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "appwrite-cli", - "version": "22.2.2", + "version": "22.2.3", "license": "BSD-3-Clause", "dependencies": { "@appwrite.io/console": "^15.1.1", diff --git a/package.json b/package.json index 5506c55..25eff2d 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "22.2.2", + "version": "22.2.3", "license": "BSD-3-Clause", "main": "dist/index.cjs", "module": "dist/index.js", diff --git a/scoop/appwrite.config.json b/scoop/appwrite.config.json index 8352a9d..2083350 100644 --- a/scoop/appwrite.config.json +++ b/scoop/appwrite.config.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "22.2.2", + "version": "22.2.3", "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.", "homepage": "https://github.com/appwrite/sdk-for-cli", "license": "BSD-3-Clause", "architecture": { "64bit": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.2/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.3/appwrite-cli-win-x64.exe", "bin": [ [ "appwrite-cli-win-x64.exe", @@ -15,7 +15,7 @@ ] }, "arm64": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.2/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/22.2.3/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe",