Software /
code /
prosody
File
util/xpcall.lua @ 10936:d770435f0f84
util.argparse: Move exiting and error to util.startup
It's not so nice to have a library that exits the entire application
from under you, so this and the error reporting belongs in util.startup.
The argparse code was originally in util.startup but moved out in
1196f1e8d178 but the error handling should have stayed.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 17 Jun 2020 19:32:12 +0200 |
parent | 9561:cfc7b2f7251e |
child | 12975:d10957394a3c |
line wrap: on
line source
local xpcall = xpcall; if select(2, xpcall(function (x) return x end, function () end, "test")) ~= "test" then xpcall = require"util.compat".xpcall; end return { xpcall = xpcall; };