INNER CODE UNIT · Go

defaultGraphqlErrorHandler

ysugimoto/grpc-graphql-gateway · runtime/error.go:26

func defaultGraphqlErrorHandler(errs []GraphqlError) {
	for i := 0; i < len(errs); i++ {
		e := errs[i]
		m := grpcBackendErrorMatcher.FindStringSubmatch(e.Message)
		if m == nil {
			continue
		}
		e.Message = m[2]
		if e.Extensions == nil {
			e.Extensions = make(map[string]interface{})
		}
		e.Extensions["code"] = strings.ToUpper(m[1])
		errs[i] = e
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…