From 7bad6cd20ab70583c6c2ebfabfacc47b27e552b4 Mon Sep 17 00:00:00 2001 From: jialin Date: Wed, 23 Apr 2025 19:47:49 +0800 Subject: [PATCH] chore: display the error message of request header --- src/pages/playground/config/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/playground/config/index.ts b/src/pages/playground/config/index.ts index 64c49697..e76a1ee3 100644 --- a/src/pages/playground/config/index.ts +++ b/src/pages/playground/config/index.ts @@ -170,10 +170,11 @@ export const extractErrorMessage = (result: any) => { result?.data?.detail || result?.data?.message || result?.error?.message || - result?.error || result?.detail || result?.message || - result?.data; + result?.data || + (result?.error === true ? 'Unknown error' : result?.error); + if (errorMsg) { return typeof errorMsg === 'string' ? errorMsg : JSON.stringify(errorMsg); }