Skip to content

Commit

Permalink
fix(schema) VALIDATION error was not reachable
Browse files Browse the repository at this point in the history
  • Loading branch information
kikito committed Oct 3, 2018
1 parent 5bc77cd commit 77eac4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kong/db/schema/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,11 @@ function Schema:validate_field(field, value)
if field[k] then
local ok, err = self.validators[k](value, field[k], field)
if not ok then
if not err then
err = (validation_errors[k:upper()]
or validation_errors.VALIDATION):format(value)
end
return nil, err
or validation_errors[k:upper()]:format(value)
or validation_errors.VALIDATION:format(value)
end
end
end
Expand Down

0 comments on commit 77eac4e

Please sign in to comment.