feat(logging): enhance error logging in webhook retry and Telegram message sending
Add detailed logging for error reasons and codes in the retryFailedWebhook function. Improve error handling in sendTelegramMessage by creating a more informative error message and logging additional response details. Update the releasehook endpoint to handle Telegram message sending synchronously, allowing for better error response management.
This commit is contained in:
@@ -15,6 +15,7 @@ async function retryFailedWebhook(filepath) {
|
||||
const payload = data.payload;
|
||||
|
||||
console.log(`Repository: ${payload?.repository?.name || 'unknown'}`);
|
||||
console.log(`Original failure reason: ${data.reason || 'unknown'}`);
|
||||
console.log(`Original error: ${data.error}`);
|
||||
console.log(`Failed at: ${data.timestamp}`);
|
||||
|
||||
@@ -45,6 +46,14 @@ async function retryFailedWebhook(filepath) {
|
||||
console.log(`Response status: ${error.response.status}`);
|
||||
console.log(`Response data:`, error.response.data);
|
||||
}
|
||||
if (error.code) {
|
||||
console.log(`Error code: ${error.code}`);
|
||||
}
|
||||
if (error.config) {
|
||||
console.log(`Request URL: ${error.config.url}`);
|
||||
console.log(`Request method: ${error.config.method}`);
|
||||
}
|
||||
console.log(`Full error details:`, error.toJSON ? error.toJSON() : error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user