From 8f74a3f78374848f138e08ecf3824b2ee7f2584e Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 5 Dec 2024 15:50:02 -0800 Subject: [PATCH] common service errors --- pkg/service/service.go | 8 ++++++++ pkg/service/submissions.go | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/service/service.go b/pkg/service/service.go index b6fe682..14a1e09 100644 --- a/pkg/service/service.go +++ b/pkg/service/service.go @@ -2,10 +2,18 @@ package service import ( "context" + "errors" "git.itzana.me/strafesnet/maps-service/pkg/api" "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 { DB datastore.Datastore } diff --git a/pkg/service/submissions.go b/pkg/service/submissions.go index 32e2a0e..b2575f9 100644 --- a/pkg/service/submissions.go +++ b/pkg/service/submissions.go @@ -12,10 +12,6 @@ import ( var ( // ErrInvalidSourceStatus current submission status cannot change to destination 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