terminusdb / terminusdb/terminusdb-client-python
All database errors are DatabaseErrors
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 80
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
Almost all database errors return the DatabaseError exception. They should return a specific exception instead as a DatabaseException can mean almost anything and catch code for specific errors can become very dirty.
See for instance: https://github.com/terminusdb/terminusdb-client-python/blob/0779fe4d3f21ff536b7ca09153bc8764d74c951a/terminusdb_client/client/Client.py#L1452-L1456
This could would be more elegant if DocumentNotFound was a specific exception.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the exception handling referenced in Client.py at lines 1452-1456 and identify how database errors are currently surfaced. Define specific exceptions for distinct error cases, including DocumentNotFound, and verify that callers can catch those cases without relying on the generic DatabaseError.
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
- Mostly clear
- Newbie friendliness
- 35/100