From 9aabc3ced7a5008fd05cf60fc9f1356957f8789d Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Mon, 28 Apr 2025 04:07:32 +0400 Subject: [PATCH] better error logs --- .../microsoft-teams/microsoft-teams-fns.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/backend/src/services/microsoft-teams/microsoft-teams-fns.ts b/backend/src/services/microsoft-teams/microsoft-teams-fns.ts index 075151c85..3a3b5ff33 100644 --- a/backend/src/services/microsoft-teams/microsoft-teams-fns.ts +++ b/backend/src/services/microsoft-teams/microsoft-teams-fns.ts @@ -547,10 +547,17 @@ export class TeamsBot extends TeamsActivityHandler { } ); } catch (error) { - logger.error( - error, - `sendMessageToChannel: Microsoft Teams Workflow Integration: Failed to send message to channel [channelId=${channelId}] [teamId=${teamId}] [tenantId=${tenantId}]` - ); + if (axios.isAxiosError(error)) { + logger.error( + error.response?.data, + `sendMessageToChannel: Axios Error, Microsoft Teams Workflow Integration: Failed to send message to channel [channelId=${channelId}] [teamId=${teamId}] [tenantId=${tenantId}]` + ); + } else { + logger.error( + error, + `sendMessageToChannel: Microsoft Teams Workflow Integration: Failed to send message to channel [channelId=${channelId}] [teamId=${teamId}] [tenantId=${tenantId}]` + ); + } throw error; } }