From 5dd1b5f4d770e9ff777bf853a7f031cdfc50f425 Mon Sep 17 00:00:00 2001 From: Stephan D Date: Fri, 13 Feb 2026 17:01:16 +0100 Subject: [PATCH] fixed error definition --- api/payments/storage/storage.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/api/payments/storage/storage.go b/api/payments/storage/storage.go index 4a5a9085..6c5d946f 100644 --- a/api/payments/storage/storage.go +++ b/api/payments/storage/storage.go @@ -2,6 +2,7 @@ package storage import ( "context" + "errors" "github.com/tech/sendico/payments/storage/model" quotestorage "github.com/tech/sendico/payments/storage/quote" @@ -9,25 +10,19 @@ import ( "go.mongodb.org/mongo-driver/v2/bson" ) -type storageError string - -func (e storageError) Error() string { - return string(e) -} - var ( // ErrPaymentNotFound signals that a payment record does not exist. - ErrPaymentNotFound = storageError("payments.storage: payment not found") + ErrPaymentNotFound = errors.New("payments.storage: payment not found") // ErrDuplicatePayment signals that idempotency constraints were violated. - ErrDuplicatePayment = storageError("payments.storage: duplicate payment") + ErrDuplicatePayment = errors.New("payments.storage: duplicate payment") // ErrRouteNotFound signals that a payment route record does not exist. - ErrRouteNotFound = storageError("payments.storage: route not found") + ErrRouteNotFound = errors.New("payments.storage: route not found") // ErrDuplicateRoute signals that a route already exists for the same transition. - ErrDuplicateRoute = storageError("payments.storage: duplicate route") + ErrDuplicateRoute = errors.New("payments.storage: duplicate route") // ErrPlanTemplateNotFound signals that a plan template record does not exist. - ErrPlanTemplateNotFound = storageError("payments.storage: plan template not found") + ErrPlanTemplateNotFound = errors.New("payments.storage: plan template not found") // ErrDuplicatePlanTemplate signals that a plan template already exists for the same transition. - ErrDuplicatePlanTemplate = storageError("payments.storage: duplicate plan template") + ErrDuplicatePlanTemplate = errors.New("payments.storage: duplicate plan template") ) var (