~bigbes/core-go

d89f65e89857d8d650db6896e105c875dfa4a560 — Drew DeVault 1 year, 4 months ago 79dad62
errors.Field: return the error
1 files changed, 2 insertions(+), 1 deletions(-)

M errors/errors.go
M errors/errors.go => errors/errors.go +2 -1
@@ 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