CentreForDigitalHumanities / CentreForDigitalHumanities/django-shared-core

Inconsistent behaviour cdh.rest.client.clients.ResourceClient

Open
#130 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Description

While the `ResourceClient` interface is quite useful, it encompasses a tricky design choice. If a REST request fails because of a `requests.exceptions.ConnectionError`, it will return `None` (in `ResourceClient.get()`) or `False` (in `put()` and `delete()`)
Other errors will cause an exception to be raised, which seems to me a more desirable choice.

I can write a PR for this change, but I'd like to know whether any other systems use `ResourceClient` besides PPN and babex.

(see https://github.com/UiL-OTS-labs/ppn-backend/issues/173 for a related issue)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.