Skip to content

Commit

Permalink
[release-21.0] Fix how we generate the query serving error documentat…
Browse files Browse the repository at this point in the history
…ion (#17516) (#17536)

Signed-off-by: Florent Poinsard <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Co-authored-by: Florent Poinsard <[email protected]>
  • Loading branch information
vitess-bot[bot] and frouioui authored Jan 21, 2025
1 parent d764feb commit 4a83f5e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion go/vt/vterrors/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4a83f5e

Please sign in to comment.