Skip to content

Commit

Permalink
Fix how we generate the query serving error documentation (#17516)
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
vitess-bot[bot] authored and vitess-bot committed Jan 15, 2025
1 parent e0c40b3 commit cc058ba
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 cc058ba

Please sign in to comment.