Skip to content

Commit

Permalink
Make the common error messages more consistent
Browse files Browse the repository at this point in the history
There are still several cases where the user could see an error not
prefixed with "pq: ", but there's no real reason why we couldn't fix
these instances.
  • Loading branch information
johto committed Feb 12, 2014
1 parent 932a348 commit 4d1372b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
)

var (
errCopyInClosed = errors.New("copyin statement has already been closed")
errBinaryCopyNotSupported = errors.New("only text format supported for COPY")
errCopyToNotSupported = errors.New("COPY TO is not supported")
errCopyNotSupportedOutsideTxn = errors.New("COPY is only allowed inside a transaction")
errCopyInClosed = errors.New("pq: copyin statement has already been closed")
errBinaryCopyNotSupported = errors.New("pq: only text format supported for COPY")
errCopyToNotSupported = errors.New("pq: COPY TO is not supported")
errCopyNotSupportedOutsideTxn = errors.New("pq: COPY is only allowed inside a transaction")
)

// CopyIn creates a COPY FROM statement which can be prepared with
Expand Down
4 changes: 2 additions & 2 deletions notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ func (l *ListenerConn) Err() error {

var errListenerClosed = errors.New("pq: Listener has been closed")

var ErrChannelAlreadyOpen = errors.New("channel is already open")
var ErrChannelNotOpen = errors.New("channel is not open")
var ErrChannelAlreadyOpen = errors.New("pq: channel is already open")
var ErrChannelNotOpen = errors.New("pq: channel is not open")

type ListenerEventType int

Expand Down

0 comments on commit 4d1372b

Please sign in to comment.