From d89f65e89857d8d650db6896e105c875dfa4a560 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 25 Mar 2025 15:12:21 +0100 Subject: [PATCH] errors.Field: return the error --- errors/errors.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/errors/errors.go b/errors/errors.go index e35ca2861d9969d9c6ce7d66e69bd112a21217fb..afd3ef70525e02bf6f53ed81803967ef369ae8a9 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -25,8 +25,9 @@ func Errorf(code ErrorCode, format string, a ...any) *gqlerror.Error { } // Sets the field name that caused the error -func Field(err *gqlerror.Error, field string) { +func Field(err *gqlerror.Error, field string) *gqlerror.Error { err.Extensions["field"] = field + return err } // Error codes as string constants