fix: check the error type and return as string

This commit is contained in:
jialin
2025-04-22 17:03:24 +08:00
parent 034b371ad4
commit 8337768c5a
+1 -1
View File
@@ -175,7 +175,7 @@ export const extractErrorMessage = (result: any) => {
result?.error?.message ||
result?.data;
if (errorMsg) {
return errorMsg;
return typeof errorMsg === 'string' ? errorMsg : JSON.stringify(errorMsg);
}
try {
return typeof result === 'string' ? result : JSON.stringify(result);