Page MenuHomeSoftware Heritage

client: Raise GraphArgumentException on 4xx response, instead of generic RemoteException.
ClosedPublic

Authored by vlorentz on May 4 2021, 12:19 PM.

Details

Reviewers
ardumont
Group Reviewers
Reviewers
Summary

For consistency with other RPC clients, and because RemoteException is too
generic to be useful (it also covers internal errors of the server, which
can be temporary errors, unlike GraphArgumentException which is for invalid
arguments)

Event Timeline

Build is green

Patch application report for D5668 (id=20243)

Rebasing onto 1a8b00f4cd...

Current branch diff-target is up to date.
Changes applied before test
commit 2364c7cd2db7f4610adff0fe7452af46a1df778f
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue May 4 12:13:55 2021 +0200

    client: Raise GraphArgumentException on 4xx response, instead of generic RemoteException.
    
    For consistency with other RPC clients, and because RemoteException is too
    generic to be useful (it also covers internal errors of the server, which
    can be temporary errors, unlike GraphArgumentException which is for invalid
    arguments)

See https://jenkins.softwareheritage.org/job/DGRPH/job/tests-on-diff/105/ for more details.

remove standalone client from the commit

Build is green

Patch application report for D5668 (id=20252)

Rebasing onto 1a8b00f4cd...

Current branch diff-target is up to date.
Changes applied before test
commit 642e8a5468675adcafc1c548abab3650e26289e2
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue May 4 12:13:55 2021 +0200

    client: Raise GraphArgumentException on 4xx response, instead of generic RemoteException.
    
    For consistency with other RPC clients, and because RemoteException is too
    generic to be useful (it also covers internal errors of the server, which
    can be temporary errors, unlike GraphArgumentException which is for invalid
    arguments)

See https://jenkins.softwareheritage.org/job/DGRPH/job/tests-on-diff/110/ for more details.

ardumont added a subscriber: ardumont.

Looks good to me.

swh/graph/client.py
39

neat ;)

This revision is now accepted and ready to land.May 5 2021, 9:44 AM
swh/graph/client.py
39

swh.core already does it this way