Use writeError for Write error

This commit is contained in:
Jack Christensen 2020-02-07 15:40:50 -06:00
parent 06c4e181b1
commit ac364e7a43

View File

@ -683,7 +683,7 @@ func (pgConn *PgConn) Prepare(ctx context.Context, name, sql string, paramOIDs [
n, err := pgConn.conn.Write(buf) n, err := pgConn.conn.Write(buf)
if err != nil { if err != nil {
pgConn.asyncClose() pgConn.asyncClose()
return nil, &pgconnError{msg: "write failed", err: err, safeToRetry: n == 0} return nil, &writeError{err: err, safeToRetry: n == 0}
} }
psd := &StatementDescription{Name: name, SQL: sql} psd := &StatementDescription{Name: name, SQL: sql}