From 5479215191fc6f114805327fcd2583d059ff7175 Mon Sep 17 00:00:00 2001
From: build-token <build-token>
Date: Thu, 6 Jul 2023 08:46:24 +0000
Subject: [PATCH] publish: chore(logs): added section tags to the logs

generated from commit cbe6228d45eafa0e6379fc6cf38bf600b10514cf
---
 index.js | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/index.js b/index.js
index b6028ad..8273322 100644
--- a/index.js
+++ b/index.js
@@ -231,19 +231,18 @@ async function authenticate(login, password, baseUrl, apiAuthKey) {
     }
   } catch (error) {
     log('debug', error.message)
-    Sentry.captureException(error, {
+    Sentry.captureException(`Authenticate failed: ${error.message}`, {
       tags: {
         section: 'authenticate',
       },
-      extra: {
-        compte: login,
-      },
     })
     throw new Error(errors.LOGIN_FAILED)
   }
 }
 
 async function getData(response, baseUrl, apiAuthKey) {
+  log('debug', 'Start date : ' + startDate)
+  log('debug', 'End date : ' + endDate)
   const dataRequest = {
     method: 'post',
     url: baseUrl + '/getAllAgregatsByAbonnement.aspx',
@@ -288,15 +287,10 @@ async function getData(response, baseUrl, apiAuthKey) {
         throw errors.UNKNOWN_ERROR
     }
   } catch (error) {
-    log('debug', error.message)
-    Sentry.captureException(error, {
+    Sentry.captureException(`GetData failed: ${error.message}`, {
       tags: {
         section: 'getData',
       },
-      extra: {
-        start: startDate,
-        end: endDate,
-      },
     })
     if (axios.isAxiosError(error)) {
       throw new Error(errors.VENDOR_DOWN)
@@ -346,8 +340,7 @@ function format(response) {
       }
     })
   } catch (error) {
-    log('debug', error.message)
-    Sentry.captureException(error, {
+    Sentry.captureException(`Format failed: ${error.message}`, {
       tags: {
         section: 'format',
       },
-- 
GitLab