fix: sanitize error details by removing sensitive headers and stack trace
This commit is contained in:
parent
6df0b02e49
commit
3f7e84e17c
@ -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…
x
Reference in New Issue
Block a user