maykinmedia / gemma-zds-client

0 stars 0 forks source link

Fix handling of empty responses #12

Closed Viicos closed 9 months ago

Viicos commented 9 months ago

zgw-consumers makes use of this client and expect the JSON response to contains specific fields:

try:
    zaaktypen = get_zaaktypen()
except ClientError as exc:
    error_message = exc.args[0]
    messages.error(
        request,
        _(
            "Failed to retrieve available zaaktypen "
            "(got {http_status} - {detail}). "
            "The cause of this exception was: {cause}"
        ).format(
            http_status=error_message["status"],
            detail=error_message["detail"],
            cause=exc.__cause__,
        ),
    )
Viicos commented 9 months ago

Fix will be implemented in zgw consumers instead.