fix: remove error types from domain package completely
domain/error.go deleted — errors do not belong in domain. All ErrNotImplemented stubs in repository.go now reference common/errors.ErrNotImplemented via cerrors alias.
This commit is contained in:
@ -1,6 +0,0 @@
|
||||
package domain
|
||||
|
||||
import "errors"
|
||||
|
||||
// ErrNotImplemented is returned by interface stubs that have not been implemented yet.
|
||||
var ErrNotImplemented = errors.New("not implemented")
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
cerrors "git.loyso.art/frx/kurious/internal/common/errors"
|
||||
"git.loyso.art/frx/kurious/internal/common/nullable"
|
||||
)
|
||||
|
||||
@ -141,20 +142,20 @@ func (NotImplementedOrganizationRepository) ListStats(
|
||||
context.Context,
|
||||
ListOrganizationsParams,
|
||||
) ([]OrganizationStat, error) {
|
||||
return nil, ErrNotImplemented
|
||||
return nil, cerrors.ErrNotImplemented
|
||||
}
|
||||
|
||||
func (NotImplementedOrganizationRepository) List(context.Context, ListOrganizationsParams) ([]Organization, error) {
|
||||
return nil, ErrNotImplemented
|
||||
return nil, cerrors.ErrNotImplemented
|
||||
}
|
||||
func (NotImplementedOrganizationRepository) Get(context.Context, GetOrganizationParams) (Organization, error) {
|
||||
return Organization{}, ErrNotImplemented
|
||||
return Organization{}, cerrors.ErrNotImplemented
|
||||
}
|
||||
func (NotImplementedOrganizationRepository) Create(context.Context, CreateOrganizationParams) (Organization, error) {
|
||||
return Organization{}, ErrNotImplemented
|
||||
return Organization{}, cerrors.ErrNotImplemented
|
||||
}
|
||||
func (NotImplementedOrganizationRepository) Delete(ctx context.Context, id string) error {
|
||||
return ErrNotImplemented
|
||||
return cerrors.ErrNotImplemented
|
||||
}
|
||||
|
||||
//go:generate mockery --name LearningCategoryRepository
|
||||
@ -168,11 +169,11 @@ type LearningCategoryRepository interface {
|
||||
type NotImplementedLearningCategory struct{}
|
||||
|
||||
func (NotImplementedLearningCategory) Upsert(context.Context, LearningCategory) error {
|
||||
return ErrNotImplemented
|
||||
return cerrors.ErrNotImplemented
|
||||
}
|
||||
func (NotImplementedLearningCategory) List(context.Context) ([]LearningCategory, error) {
|
||||
return nil, ErrNotImplemented
|
||||
return nil, cerrors.ErrNotImplemented
|
||||
}
|
||||
func (NotImplementedLearningCategory) Get(context.Context, string) (LearningCategory, error) {
|
||||
return LearningCategory{}, ErrNotImplemented
|
||||
return LearningCategory{}, cerrors.ErrNotImplemented
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user