common service errors

This commit is contained in:
Quaternions 2024-12-05 15:50:02 -08:00
parent 8c254aef6e
commit 8f74a3f783
2 changed files with 8 additions and 4 deletions

View File

@ -2,10 +2,18 @@ package service
import ( import (
"context" "context"
"errors"
"git.itzana.me/strafesnet/maps-service/pkg/api" "git.itzana.me/strafesnet/maps-service/pkg/api"
"git.itzana.me/strafesnet/maps-service/pkg/datastore" "git.itzana.me/strafesnet/maps-service/pkg/datastore"
) )
var (
// ErrPermissionDenied caller does not have the required role
ErrPermissionDenied = errors.New("Permission denied")
// ErrUserInfo user info is missing for some reason
ErrUserInfo = errors.New("Missing user info")
)
type Service struct { type Service struct {
DB datastore.Datastore DB datastore.Datastore
} }

View File

@ -12,10 +12,6 @@ import (
var ( var (
// ErrInvalidSourceStatus current submission status cannot change to destination status // ErrInvalidSourceStatus current submission status cannot change to destination status
ErrInvalidSourceStatus = errors.New("Invalid source status") ErrInvalidSourceStatus = errors.New("Invalid source status")
// ErrPermissionDenied caller does not have the required role
ErrPermissionDenied = errors.New("Permission denied")
// ErrUserInfo user info is missing for some reason
ErrUserInfo = errors.New("Missing user info")
) )
// POST /submissions // POST /submissions