~sircmpwn/sr.ht-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH core.sr.ht 1/2] graphql: parse response JSON once on error

Details
Message ID
<20230314153352.390657-1-contact@emersion.fr>
DKIM signature
pass
Download raw message
Patch: +1 -1
---
 srht/graphql/client.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srht/graphql/client.py b/srht/graphql/client.py
index 18b4b015e86f..01176c30ae7e 100644
--- a/srht/graphql/client.py
+++ b/srht/graphql/client.py
@@ -96,7 +96,7 @@ class GraphQLOperation:
        resp = r.json()
        if r.status_code != 200 or "errors" in resp:
            if valid is None:
                raise GraphQLError(r.json())
                raise GraphQLError(resp)
            else:
                _copy_errors(valid, resp)
                return resp.get("data")

base-commit: 599f3fe4771b4db18c982c571261942d2e199fe9
-- 
2.39.2

[PATCH core.sr.ht 2/2] graphql: set GraphQLError.data

Details
Message ID
<20230314153352.390657-2-contact@emersion.fr>
In-Reply-To
<20230314153352.390657-1-contact@emersion.fr> (view parent)
DKIM signature
pass
Download raw message
Patch: +1 -0
Even if errors occured, the server may return data. Store that
data in GraphQLError.data so that callers can easily access it.
---
 srht/graphql/client.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srht/graphql/client.py b/srht/graphql/client.py
index 01176c30ae7e..a7dac0745f5a 100644
--- a/srht/graphql/client.py
+++ b/srht/graphql/client.py
@@ -11,6 +11,7 @@ class GraphQLError(Exception):
    def __init__(self, body):
        self.body = body
        self.errors = body["errors"]
        self.data = body.get("data")

def exec_gql(site, query, user=None, client_id=None, valid=None, **variables):
    op = GraphQLOperation(query)
-- 
2.39.2

[core.sr.ht/patches] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CR67VVK6452L.3EMXICQ9EMZKC@cirno2>
In-Reply-To
<20230314153352.390657-2-contact@emersion.fr> (view parent)
DKIM signature
missing
Download raw message
core.sr.ht/patches: FAILED in 4m35s

[graphql: parse response JSON once on error][0] from [Simon Ser][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/39709
[1]: contact@emersion.fr

✗ #957069 FAILED  core.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/957069
✓ #957068 SUCCESS core.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/957068
✓ #957070 SUCCESS core.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/957070

Re: [PATCH core.sr.ht 2/2] graphql: set GraphQLError.data

Details
Message ID
<CR6WVZLYGX9M.1CVKAZILER7ZK@taiga>
In-Reply-To
<20230314153352.390657-2-contact@emersion.fr> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/core.sr.ht
   599f3fe..ea11cd4  master -> master
Reply to thread Export thread (mbox)