feat(account): #49 refactor error handling
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 3m55s
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 3m55s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"spend-sparrow/log"
|
||||
"spend-sparrow/types"
|
||||
|
||||
@@ -100,6 +101,9 @@ func (db AccountSqlite) Get(userId uuid.UUID, id uuid.UUID) (*types.Account, err
|
||||
WHERE user_id = ?
|
||||
AND id = ?`, userId, id)
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, ErrNotFound
|
||||
}
|
||||
log.Error("account Get: %v", err)
|
||||
return nil, types.ErrInternal
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user