fix: improved error message formatting in api service

This commit is contained in:
kangfenmao 2025-01-07 10:19:21 +08:00
parent abf4d90f4e
commit 7cadb0017c

View File

@ -232,7 +232,11 @@ function formatErrorMessage(error: any): string {
try { try {
return ( return (
'```json\n' + '```json\n' +
JSON.stringify(error?.response?.data || error?.response || error?.request || error, null, 2) + JSON.stringify(
error?.error?.message || error?.response?.data || error?.response || error?.request || error,
null,
2
) +
'\n```' '\n```'
) )
} catch (e) { } catch (e) {