Skip to content

can't catch error #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
transtone opened this issue Mar 7, 2025 · 0 comments
Open

can't catch error #164

transtone opened this issue Mar 7, 2025 · 0 comments

Comments

@transtone
Copy link

I use casbin.postgresql adapter

local ok, err = pcall(function()
    local a = Adapter:new(pg_conf, "auth_casbin_rule")
    local ef = Enforcer:new("/usr/local/openresty/nginx/conf/lua/casbin/rbac_model_dom.conf", a)
    ef:loadPolicy()
end)

when I use a wrong password in pg_conf, it will get a error in error.log file,
but I can't get the error with pcall like above, it always get ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant