diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-04-05 00:56:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-05 00:56:31 +0800 |
commit | 3a5c93eeff470dda5dc4f729a1d3eef3bcb8622b (patch) | |
tree | b647fc449341a5fb1006a2c70d479ebe4377b15b /internal/db/lfs.go | |
parent | 4aff4d66ec3e118248129505bc1d70395f47dfbb (diff) |
db: use gorm function to check `ErrRecordNotFound` (#6060)
Diffstat (limited to 'internal/db/lfs.go')
-rw-r--r-- | internal/db/lfs.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/db/lfs.go b/internal/db/lfs.go index bf1af0bb..3868a20c 100644 --- a/internal/db/lfs.go +++ b/internal/db/lfs.go @@ -107,7 +107,7 @@ func (db *lfs) GetObjectByOID(repoID int64, oid lfsutil.OID) (*LFSObject, error) object := new(LFSObject) err := db.Where("repo_id = ? AND oid = ?", repoID, oid).First(object).Error if err != nil { - if err == gorm.ErrRecordNotFound { + if gorm.IsRecordNotFoundError(err) { return nil, ErrLFSObjectNotExist{args: errutil.Args{"repoID": repoID, "oid": oid}} } return nil, err |