Skip to content

All database errors are DatabaseErrors #349

Open
@rrooij

Description

@rrooij

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:

except DatabaseError as exception:
body = exception.error_obj
if exception.status_code == 404 and "api:error" in body and body["api:error"]["@type"] == "api:DocumentNotFound":
return False
raise exception

This could would be more elegant if DocumentNotFound was a specific exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: python clientrelevant to python clientbugSomething isn't workingtriageissue to be triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions