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
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)
}