Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

All database errors are DatabaseErrors #349

Open

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.

Activity

  1. added
    bug
    on Sep 6, 2022
  2. added
    area: python client
    triage
    on Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: python clientbugtriage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions