2
0

🔒 (logs) Remove some logs from API response to avoid sensit…

This commit is contained in:
Baptiste Arnaud
2024-01-02 15:18:20 +01:00
parent 7a417c79a5
commit b5fbba7072
5 changed files with 38 additions and 8 deletions

View File

@ -41,6 +41,9 @@ export const longReqTimeoutWhitelist = [
'https://api.anthropic.com',
]
export const webhookSuccessDescription = `Webhook successfuly executed.`
export const webhookErrorDescription = `Webhook returned an error.`
type Params = { disableRequestTimeout?: boolean }
export const executeWebhookBlock = async (
@ -201,7 +204,7 @@ export const executeWebhook = async (
const response = await got(request.url, omit(request, 'url'))
logs.push({
status: 'success',
description: `Webhook successfuly executed.`,
description: webhookSuccessDescription,
details: {
statusCode: response.statusCode,
request,
@ -224,7 +227,7 @@ export const executeWebhook = async (
}
logs.push({
status: 'error',
description: `Webhook returned an error.`,
description: webhookErrorDescription,
details: {
statusCode: error.response.statusCode,
request,