added error not found
This commit is contained in:
parent
f997b952c3
commit
5c863f56bd
@ -5,6 +5,7 @@ import (
|
||||
"database/sql"
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/dal/sqlcgen"
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/model"
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/pj_errors"
|
||||
)
|
||||
|
||||
type TgRepo struct {
|
||||
@ -41,6 +42,9 @@ func (r *TgRepo) CreateTgAccount(ctx context.Context, data model.TgAccount) (int
|
||||
func (r *TgRepo) GetAllTgAccounts(ctx context.Context) ([]model.TgAccount, error) {
|
||||
rows, err := r.queries.GetAllTgAccounts(ctx)
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, pj_errors.ErrNotFound
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
var result []model.TgAccount
|
||||
|
Loading…
Reference in New Issue
Block a user