-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hello,
When attempting to redact a GaxiosError object, the redact() function throws a TypeError due to trying to set a read-only property:
TypeError: Cannot set property data of #<Body> which has only a getter
Steps to Reproduce
const pinoRedact = require('@pinojs/redact')
const { request } = require('gaxios')
const redact = pinoRedact({
paths: ['response.data'],
censor: '[REDACTED]'
})
async function test() {
try {
await request({
url: 'https://httpbin.org/status/401'
})
} catch (error) {
const redactedError = redact(error) // Throws TypeError here
return redactedError
}
}
test().catch(err => console.error('Unexpected error:', err))Environment
@pinojs/redactversion: 0.4.0gaxiosversion: 7.1.3- Node.js version: 22.16.0
Would it possible to fix this behavior, or is the only solution to not pass an object like that to pino ?
Metadata
Metadata
Assignees
Labels
No labels