From 2ffeb108877c01807cbd07a1d5dd7489c14e7212 Mon Sep 17 00:00:00 2001 From: Jeremy Oustrich Date: Fri, 10 Jul 2026 15:55:10 -0400 Subject: [PATCH] Improve error messages, particularly for errors from the Ditto API --- lib/src/index.ts | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/index.ts b/lib/src/index.ts index 294e512..db464d8 100644 --- a/lib/src/index.ts +++ b/lib/src/index.ts @@ -13,7 +13,7 @@ import appContext from "./utils/appContext"; import { ErrorType, isDittoError, isDittoErrorType } from "./utils/DittoError"; import processCommandMetaFlag from "./utils/processCommandMetaFlag"; -const handleCommandError = async (error: unknown) => { +const handleCommandError = async (error: any) => { if (process.env.DEBUG === "true") { console.error(logger.info("Development stack trace:\n"), error); } @@ -21,6 +21,7 @@ const handleCommandError = async (error: unknown) => { let sentryOptions = undefined; let exitCode = undefined; let errorText = + error.message || "Something went wrong. Please contact support or try again later."; if (isDittoError(error)) { diff --git a/package.json b/package.json index 3a1748d..f36ecf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dittowords/cli", - "version": "5.6.0", + "version": "5.6.1", "description": "Command Line Interface for Ditto (dittowords.com).", "license": "MIT", "main": "bin/ditto.js",