mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-04 20:00:00 +08:00
fix: sanitize error details by removing sensitive headers and stack trace
This commit is contained in:
parent
27dd093043
commit
1b00d5d3dc
@ -30,6 +30,9 @@ export function formatErrorMessage(error: any): string {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const detailedError = getErrorDetails(error)
|
const detailedError = getErrorDetails(error)
|
||||||
|
delete detailedError?.headers
|
||||||
|
delete detailedError?.stack
|
||||||
|
delete detailedError?.request_id
|
||||||
return '```json\n' + JSON.stringify(detailedError, null, 2) + '\n```'
|
return '```json\n' + JSON.stringify(detailedError, null, 2) + '\n```'
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user