Bug #56882

opendatasoft: les réponses 404 ne contiennent pas de JSON

Added by sentry io 17 days ago. Updated 13 days ago.

Solution déployée
Target version:
Start date:
11 Sep 2021
Due date:
% Done:


Estimated time:
Patch proposed:


JSONDecodeError: Expecting value: line 2 column 1 (char 1)
(3 additional frame(s) were not displayed)
  File "passerelle/apps/opendatasoft/", line 88, in call_search
    err_desc = result_response.json().get('error')
  File "requests/", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "", line 348, in loads
    return _default_decoder.decode(s)
  File "json/", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "json/", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None

Error occurred while processing request


Associated revisions

Revision 74895168 (diff)
Added by Nicolas Roche 13 days ago

opendatasoft: manage HTTP errors (#56882)



Updated by Benjamin Dauvergne 17 days ago

  • Project changed from Suivi des traces to Passerelle

Updated by Nicolas Roche 15 days ago

  • Assignee set to Nicolas Roche

Updated by Nicolas Roche 14 days ago

Le code et un peu différent que d'habitude parce que l'api d'opendatasoft prévoit un message d'erreur mais ne précise rien sur le statut HTTP.

When an error occurs, a JSON object describing the error is returned by the API.

Dans les faits on se retrouve avec des 4XX qui renseignent ce message et d'autres non :
$ curl -v

< HTTP/2 400
{"error": "Parameter 'dataset' is mandatory."}

curl -v
< HTTP/2 404
...pas du json...


Updated by Benjamin Dauvergne 14 days ago

  • Status changed from Solution proposée to Solution validée

Updated by Nicolas Roche 13 days ago

  • Status changed from Solution validée to Résolu (à déployer)
commit 74895168a8123b994d24825c44dee5909aabf06b
Author: Nicolas ROCHE <>
Date:   Mon Sep 13 18:04:18 2021 +0200

    opendatasoft: manage HTTP errors (#56882)

Updated by Frédéric Péters 13 days ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF