Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
enedis_sge_konnector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
enedis_sge_konnector
Commits
9cf23a81
Commit
9cf23a81
authored
2 years ago
by
Bastien DUMONT
Browse files
Options
Downloads
Patches
Plain Diff
publish: wip basic transactions
generated from commit
5dfb3525
parent
7a8e74b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
index.js
+25
-17
25 additions, 17 deletions
index.js
with
25 additions
and
17 deletions
index.js
+
25
−
17
View file @
9cf23a81
...
@@ -99,15 +99,15 @@ async function start(fields, cozyParameters) {
...
@@ -99,15 +99,15 @@ async function start(fields, cozyParameters) {
Sentry.captureEvent({ message: 'konnector launch 3' })
Sentry.captureEvent({ message: 'konnector launch 3' })
setTimeout(() => {
//
setTimeout(() => {
try {
//
try {
test()
//
test()
} catch (e) {
//
} catch (e) {
Sentry.captureException(e)
//
Sentry.captureException(e)
} finally {
//
} finally {
// transaction.finish()
//
// transaction.finish()
}
//
}
}, 99)
//
}, 99)
const pointId = parseInt(fields.pointId)
const pointId = parseInt(fields.pointId)
let baseUrl = fields.wso2BaseUrl
let baseUrl = fields.wso2BaseUrl
...
@@ -166,7 +166,7 @@ async function start(fields, cozyParameters) {
...
@@ -166,7 +166,7 @@ async function start(fields, cozyParameters) {
user.hasBeenThroughtSafetyOnBoarding
user.hasBeenThroughtSafetyOnBoarding
)
)
// handle user contract start date in order to pr
e
perly request data
// handle user contract start date in order to pr
o
perly request data
const userContractstartDate = await getContractStartDate(
const userContractstartDate = await getContractStartDate(
baseUrl,
baseUrl,
apiAuthKey,
apiAuthKey,
...
@@ -544,7 +544,7 @@ function processData(doctype = 'com.grandlyon.enedis.day') {
...
@@ -544,7 +544,7 @@ function processData(doctype = 'com.grandlyon.enedis.day') {
`No half-hour activated. Issue: ${result.Envelope.Body.Fault.faultstring}`
`No half-hour activated. Issue: ${result.Envelope.Body.Fault.faultstring}`
)
)
} else {
} else {
log('warn', `Unkown error ${e}`)
log('warn', `Unk
n
own error ${e}`)
}
}
}
}
}
}
...
@@ -567,7 +567,7 @@ async function storeData(data, doctype, filterKeys) {
...
@@ -567,7 +567,7 @@ async function storeData(data, doctype, filterKeys) {
}
}
/**
/**
* Agregate data from daily data to monthly and yearly data
* Ag
g
regate data from daily data to monthly and yearly data
*/
*/
async function agregateMonthAndYearData(data) {
async function agregateMonthAndYearData(data) {
// Sum year and month values into object with year or year-month as keys
// Sum year and month values into object with year or year-month as keys
...
@@ -611,10 +611,10 @@ function isFirstStart(account) {
...
@@ -611,10 +611,10 @@ function isFirstStart(account) {
log('info', 'Konnector first start')
log('info', 'Konnector first start')
return true
return true
}
}
function test() {
//
function test() {
Sentry.captureException('capture exception inside test')
//
Sentry.captureException('capture exception inside test')
throw new Error('Function test not implemented.')
//
throw new Error('Function test not implemented.')
}
//
}
/***/ }),
/***/ }),
...
@@ -242104,6 +242104,7 @@ const {
...
@@ -242104,6 +242104,7 @@ const {
} = __webpack_require__(1561)
} = __webpack_require__(1561)
const xml2js = __webpack_require__(1519)
const xml2js = __webpack_require__(1519)
const { consulterDonneesTechniquesContractuelles } = __webpack_require__(1562)
const { consulterDonneesTechniquesContractuelles } = __webpack_require__(1562)
const Sentry = __webpack_require__(1610)
/**
/**
* Get user contract start date
* Get user contract start date
...
@@ -242138,12 +242139,19 @@ async function findUserAddress(url, apiAuthKey, userLogin, pointId) {
...
@@ -242138,12 +242139,19 @@ async function findUserAddress(url, apiAuthKey, userLogin, pointId) {
try {
try {
return parseUserAddress(result)
return parseUserAddress(result)
} catch (error) {
} catch (error) {
log('error', 'Error while processing user address: ' + error)
const errorMessage = 'Error while processing user address: ' + error
log('error', errorMessage)
log(
log(
'error',
'error',
`Enedis issue ${result.Envelope.Body.Fault.detail.erreur.resultat.$.code}: ${result.Envelope.Body.Fault.faultstring}`
`Enedis issue ${result.Envelope.Body.Fault.detail.erreur.resultat.$.code}: ${result.Envelope.Body.Fault.faultstring}`
)
)
Sentry.captureException(errorMessage)
Sentry.captureEvent({ message: errorMessage })
pwet()
throw errors.LOGIN_FAILED
throw errors.LOGIN_FAILED
} finally {
log('info', 'FINALLY')
Sentry.captureException('Error while processing user address')
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment