ch logika
This commit is contained in:
@@ -290,8 +290,11 @@ func (h *handler) delete(c *gin.Context) {
|
||||
}
|
||||
|
||||
func isClientError(err error) bool {
|
||||
switch err.Error() {
|
||||
case "province not found", "unsupported region", "could not generate a unique branch code, try again":
|
||||
switch {
|
||||
case err.Error() == "province not found",
|
||||
err.Error() == "unsupported region",
|
||||
err.Error() == "unique code already exists",
|
||||
strings.HasPrefix(err.Error(), "unique code must start with"):
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user