add new errors

This commit is contained in:
Alex
2025-03-11 20:42:05 +01:00
parent 0c3204df15
commit 0d6013d566

View File

@@ -18,6 +18,7 @@ type ValidationKeys struct {
NotFound string NotFound string
InUse string InUse string
UndeliveredVerificationMail string UndeliveredVerificationMail string
UserAlreadyVerified string
} }
type ValidationFields struct { type ValidationFields struct {
@@ -28,6 +29,7 @@ type ValidationFields struct {
Email string Email string
User string User string
Licences string Licences string
Verification string
} }
var ( var (
@@ -72,6 +74,7 @@ var Responses = struct {
NotFound: "server.error.not_found", NotFound: "server.error.not_found",
InUse: "server.error.in_use", InUse: "server.error.in_use",
UndeliveredVerificationMail: "server.error.undelivered_verification_mail", UndeliveredVerificationMail: "server.error.undelivered_verification_mail",
UserAlreadyVerified: "server.validation.user_already_verified",
}, },
Fields: ValidationFields{ Fields: ValidationFields{
General: "server.general", General: "server.general",
@@ -81,5 +84,10 @@ var Responses = struct {
Email: "user.email", Email: "user.email",
User: "user.user", User: "user.user",
Licences: "licence", Licences: "licence",
Verification: "verification",
}, },
} }
func Is(err error, target error) bool {
return errors.Is(err, target)
}