Skip to content

Commit

Permalink
fix(init) ensure DAO init errors are correctly reported
Browse files Browse the repository at this point in the history
Since they are tables in the old DAO, this would fail with a super-sed:
error "bad argument #2 to 'assert'"
  • Loading branch information
thibaultcha committed Feb 22, 2018
1 parent 9b4a280 commit 637532e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kong/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ function Kong.init()
local config = assert(conf_loader(conf_path))

local dao = assert(DAOFactory.new(config)) -- instantiate long-lived DAO
assert(dao:init())
local ok, err_t = dao:init()
if not ok then
error(tostring(err_t))
end

assert(dao:are_migrations_uptodate())

-- populate singletons
Expand Down

0 comments on commit 637532e

Please sign in to comment.