From db575425fe59014f336a3430d014468944798f44 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Wed, 2 Apr 2025 10:39:10 -0400 Subject: [PATCH] [nit] Show error message from response (#3308) --- src/scripts/api.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/scripts/api.ts b/src/scripts/api.ts index 9ebde1ad6..9764efd68 100644 --- a/src/scripts/api.ts +++ b/src/scripts/api.ts @@ -156,11 +156,12 @@ export class PromptExecutionError extends Error { } override toString() { - let message = super.message + let message = '' if (typeof this.response.error === 'string') { - message += ': ' + this.response.error - } else if (this.response.error.details) { - message += ': ' + this.response.error.details + message += this.response.error + } else if (this.response.error) { + message += + this.response.error.message + ': ' + this.response.error.details } for (const [_, nodeError] of Object.entries(