From 4a83f5ed96087818636789eda932075803d82792 Mon Sep 17 00:00:00 2001 From: "vitess-bot[bot]" <108069721+vitess-bot[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 11:51:29 -0600 Subject: [PATCH] [release-21.0] Fix how we generate the query serving error documentation (#17516) (#17536) Signed-off-by: Florent Poinsard Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> Co-authored-by: Florent Poinsard --- go/vt/vterrors/code.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/go/vt/vterrors/code.go b/go/vt/vterrors/code.go index 31c98cef280..bb20097e1da 100644 --- a/go/vt/vterrors/code.go +++ b/go/vt/vterrors/code.go @@ -240,8 +240,15 @@ func errorWithoutState(id string, code vtrpcpb.Code, short, long string) func(ar func errorWithState(id string, code vtrpcpb.Code, state State, short, long string) func(args ...any) *VitessError { return func(args ...any) *VitessError { + var err error + if len(args) != 0 { + err = NewErrorf(code, state, id+": "+short, args...) + } else { + err = NewError(code, state, id+": "+short) + } + return &VitessError{ - Err: NewErrorf(code, state, id+": "+short, args...), + Err: err, Description: long, ID: id, State: state,