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

change: Catch error serviceSouscritId

parent d695d886
No related branches found
No related tags found
2 merge requests!64Merge dev into main,!60change: Catch error serviceSouscritId
......@@ -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