Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

tpl: support sql.ErrNoRows #104

Open
scbizu opened this issue Feb 17, 2020 · 0 comments
Open

tpl: support sql.ErrNoRows #104

scbizu opened this issue Feb 17, 2020 · 0 comments

Comments

@scbizu
Copy link
Member

scbizu commented Feb 17, 2020

proposal

We should modify the unspecific error fmt.Errorf("OperXXX has no rows") into the certain error type sql.ErrNoRows in the most FetchXXX funcs.

And wraps this error with fmt.Errorf("DBTable: %w", sql.ErrNoRows)

advantages

With this patch , we can simply use errors.Is(err,sql.ErrNoRows) to check if it is a no rows error in the upstream codes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant