From 27dd89a810476dc8ed9541a81ad9c1dc1a512b23 Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Thu, 4 Nov 2021 21:37:56 +0100 Subject: [PATCH] logconfig: link issue #72452 in the error message Release note: None --- pkg/util/log/logconfig/BUILD.bazel | 1 + pkg/util/log/logconfig/validate.go | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/util/log/logconfig/BUILD.bazel b/pkg/util/log/logconfig/BUILD.bazel index cdb8f7ecbaf7..48374a7312a6 100644 --- a/pkg/util/log/logconfig/BUILD.bazel +++ b/pkg/util/log/logconfig/BUILD.bazel @@ -24,6 +24,7 @@ go_library( importpath = "github.com/cockroachdb/cockroach/pkg/util/log/logconfig", visibility = ["//visibility:public"], deps = [ + "//pkg/build", "//pkg/util/log/logpb", "@com_github_cockroachdb_errors//:errors", "@com_github_dustin_go_humanize//:go-humanize", diff --git a/pkg/util/log/logconfig/validate.go b/pkg/util/log/logconfig/validate.go index 5c22b0d93abf..bccc35b830b0 100644 --- a/pkg/util/log/logconfig/validate.go +++ b/pkg/util/log/logconfig/validate.go @@ -20,6 +20,7 @@ import ( "strings" "time" + "github.com/cockroachdb/cockroach/pkg/build" "github.com/cockroachdb/cockroach/pkg/util/log/logpb" "github.com/cockroachdb/errors" ) @@ -324,7 +325,14 @@ func (c *Config) newFileSinkConfig(groupName string) *FileSinkConfig { func (c *Config) validateFileSinkConfig(fc *FileSinkConfig, defaultLogDir *string) error { propagateFileDefaults(&fc.FileDefaults, c.FileDefaults) if !fc.Buffering.IsNone() { - return errors.New(`"buffering" not yet supported for file-groups. Use "buffered-writes".`) + // We cannot use unimplemented.WithIssue() here because of a + // circular dependency. + err := errors.UnimplementedError( + errors.IssueLink{IssueURL: build.MakeIssueURL(72452)}, + `unimplemented: "buffering" not yet supported for file-groups`) + err = errors.WithHint(err, `Use "buffered-writes".`) + err = errors.WithTelemetry(err, "#72452") + return err } if fc.Dir != c.FileDefaults.Dir { // A directory was specified explicitly. Normalize it.