diff --git a/index.js b/index.js index b6028ad2be57e80e1aa3468863024313fb249f26..82733226c6fe1a525c3043d567f5dd9673f2e8c7 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', },