From 233685307ab5bd95b105b5360cb416f29a545894 Mon Sep 17 00:00:00 2001 From: Jessica Gadling Date: Wed, 15 Jan 2025 17:06:35 -0500 Subject: [PATCH] Allow Strawberry's GQL errors to pass through without changes. --- platformics/graphql_api/core/error_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platformics/graphql_api/core/error_handler.py b/platformics/graphql_api/core/error_handler.py index a610699..c4b8933 100644 --- a/platformics/graphql_api/core/error_handler.py +++ b/platformics/graphql_api/core/error_handler.py @@ -45,6 +45,11 @@ class DefaultExceptionHandler(ExceptionHandler): error_message: str = "Unexpected error." def convert_exception(self, err: Any) -> list[GraphQLError]: + try: + if isinstance(err, GraphQLError) and not err.original_error: + return [err] + except AttributeError: + pass return [ GraphQLError( message=self.error_message,