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

Merge branch 'change/handle-serviceSouscritId' into 'dev'

change: Catch error serviceSouscritId

See merge request !60
parents d695d886 116816ab
No related branches found
No related tags found
2 merge requests!64Merge dev into main,!60change: Catch error serviceSouscritId
Pipeline #105325 passed
......@@ -75,9 +75,17 @@ function parseContracts(result) {
function parseServiceId(result) {
log('info', 'Parsing serviceId')
const json = JSON.stringify(result)
return JSON.parse(json)['Envelope']['Body'][
'commanderCollectePublicationMesuresResponse'
]['serviceSouscritId']
const contractInfo =
JSON.parse(json)['Envelope']['Body'][
'commanderCollectePublicationMesuresResponse'
]
if (contractInfo !== undefined) {
return contractInfo['serviceSouscritId']
} else {
throw new Error(
"No serviceSouscritId found, contract hasn't been created properly."
)
}
}
/**
......
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