Standard library / database/sql/driver
driver.ErrBadConn
Signals an unusable connection that may be retried. Never return it if the server might already have executed the operation. The example verifies wrapped-error identity. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
var ErrBadConn = errors.New("driver: bad connection")Working Example
Example Snippetgo
package main
import ( "database/sql/driver" "errors" "fmt")
func main() { fmt.Println(errors.Is(fmt.Errorf("wrapped: %w", driver.ErrBadConn), driver.ErrBadConn)) }