Commit a47ca172 authored by Hugo NOUTS's avatar Hugo NOUTS
Browse files

catch dead consent error

parent c53e1ed4
......@@ -112,6 +112,9 @@ async function getData(token, idPCE) {
.then(result => {
return result.match(/.+/g).map(s => {
result = JSON.parse(s)
if (result.statut_restitution !== null) {
throw new Error(result.statut_restitution.code + ' - ' + result.statut_restitution.message)
}
return result.consommation
})
})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment