From a83893afa086f0050c825144fa818024db4df056 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 1 Apr 2026 23:25:54 -0500 Subject: feat: add Look Up screen and restrict management actions to owners Implements: https://todo.sr.ht/~ccleberg/Hutch/4 --- Hutch/Networking/SRHTClient.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Hutch/Networking/SRHTClient.swift') diff --git a/Hutch/Networking/SRHTClient.swift b/Hutch/Networking/SRHTClient.swift index ddbd97f..1b8b9b3 100644 --- a/Hutch/Networking/SRHTClient.swift +++ b/Hutch/Networking/SRHTClient.swift @@ -98,6 +98,11 @@ final class SRHTClient: Sendable { } } + if let errorEnvelope = try? decoder.decode(GraphQLResponse.self, from: data), + let errors = errorEnvelope.errors, !errors.isEmpty { + throw SRHTError.graphQLErrors(errors) + } + // Decode GraphQL response envelope let graphQLResponse: GraphQLResponse do { @@ -248,6 +253,11 @@ final class SRHTClient: Sendable { } } + if let errorEnvelope = try? decoder.decode(GraphQLResponse.self, from: data), + let errors = errorEnvelope.errors, !errors.isEmpty { + throw SRHTError.graphQLErrors(errors) + } + let graphQLResponse: GraphQLResponse do { graphQLResponse = try decoder.decode(GraphQLResponse.self, from: data) -- cgit v1.2.3