Skip to content

Commit

Permalink
Implemented a missing formatter method for WrappedInsertError
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmu committed Jan 30, 2025
1 parent eff2c25 commit ede8399
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sql/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package sql

import (
"fmt"
"io"
"strings"

"github.com/dolthub/vitess/go/mysql"
Expand Down Expand Up @@ -1068,6 +1069,15 @@ func (w WrappedInsertError) Error() string {
return w.Cause.Error()
}

// Format implements fmt.Formatter
func (w WrappedInsertError) Format(s fmt.State, verb rune) {
if fmtErr, ok := w.Cause.(fmt.Formatter); ok {
fmtErr.Format(s, verb)
return
}
_, _ = io.WriteString(s, w.Error())
}

// IgnorableError is used propagate information about an error that needs to be ignored and does not interfere with
// any update accumulators
type IgnorableError struct {
Expand Down

0 comments on commit ede8399

Please sign in to comment.