From 0d6013d566569a904ace60ba05c49cc0db8dac20 Mon Sep 17 00:00:00 2001 From: Alex <$(pass /github/email)> Date: Tue, 11 Mar 2025 20:42:05 +0100 Subject: [PATCH] add new errors --- go-backend/pkg/errors/errors.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/go-backend/pkg/errors/errors.go b/go-backend/pkg/errors/errors.go index 5b474c2..49feac0 100644 --- a/go-backend/pkg/errors/errors.go +++ b/go-backend/pkg/errors/errors.go @@ -18,6 +18,7 @@ type ValidationKeys struct { NotFound string InUse string UndeliveredVerificationMail string + UserAlreadyVerified string } type ValidationFields struct { @@ -28,6 +29,7 @@ type ValidationFields struct { Email string User string Licences string + Verification string } var ( @@ -72,6 +74,7 @@ var Responses = struct { NotFound: "server.error.not_found", InUse: "server.error.in_use", UndeliveredVerificationMail: "server.error.undelivered_verification_mail", + UserAlreadyVerified: "server.validation.user_already_verified", }, Fields: ValidationFields{ General: "server.general", @@ -81,5 +84,10 @@ var Responses = struct { Email: "user.email", User: "user.user", Licences: "licence", + Verification: "verification", }, } + +func Is(err error, target error) bool { + return errors.Is(err, target) +}