cognitedata / cognitedata/cognite-sdk-python

ValueErrors too generic too do a proper error handling

Open
#853 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
92
Forks
38
Avg merge
2d 9h
Merged PRs (30d)
42

Description

https://github.com/cognitedata/cognite-sdk-python/blob/3048fe032a5245290a34dcf7f296561663ec924b/cognite/client/_api_client.py#L688

There are a lot of ValueErrors raised in this file (and I suppose also other locations in the cognite api client)
These errors are too generic to do a proper error handling with. If the cognite api client is used in any other part of the API, it is unclear whether these ValueErrors should be transformed to 400, 403, or 500 errors.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue points to cognite/client/_api_client.py around line 688; begin by inventorying the ValueErrors there and in the other API-client locations mentioned. Clarify the intended distinction between client error categories and the acceptance criteria with maintainers before changing them, since the issue does not name specific exceptions or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.