Skip to content
Snippets Groups Projects
Commit 64f11512 authored by Pierre Ecarlat's avatar Pierre Ecarlat
Browse files

Catch error serviceSouscritId

parent 735daa43
No related branches found
No related tags found
1 merge request!64Merge dev into main
Pipeline #105126 passed
...@@ -75,9 +75,22 @@ function parseContracts(result) { ...@@ -75,9 +75,22 @@ function parseContracts(result) {
function parseServiceId(result) { function parseServiceId(result) {
log('info', 'Parsing serviceId') log('info', 'Parsing serviceId')
const json = JSON.stringify(result) const json = JSON.stringify(result)
return JSON.parse(json)['Envelope']['Body'][ const contractInfo =
'commanderCollectePublicationMesuresResponse' JSON.parse(json)['Envelope']['Body'][
]['serviceSouscritId'] 'commanderCollectePublicationMesuresResponse'
]
if (contractInfo !== undefined) {
return contractInfo['serviceSouscritId']
} else {
const errorMessage =
"No serviceSouscritId found, contract hasn't been created properly."
Sentry.captureException(errorMessage, {
tags: {
section: 'parseServiceId',
},
})
throw new Error(errorMessage)
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment