add new errors
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user