terminusdb / terminusdb/terminusdb-client-python

All database errors are DatabaseErrors

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

Nobody has claimed this yet.

area: python client bug triage
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.