better error logs

This commit is contained in:
Daniel Hougaard
2025-04-28 04:07:32 +04:00
parent fe9ec6b030
commit 9aabc3ced7
@@ -547,10 +547,17 @@ export class TeamsBot extends TeamsActivityHandler {
} }
); );
} catch (error) { } catch (error) {
logger.error( if (axios.isAxiosError(error)) {
error, logger.error(
`sendMessageToChannel: Microsoft Teams Workflow Integration: Failed to send message to channel [channelId=${channelId}] [teamId=${teamId}] [tenantId=${tenantId}]` 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; throw error;
} }
} }