diff options
Diffstat (limited to 'xmake/core/sandbox/modules/try.lua')
| -rw-r--r-- | xmake/core/sandbox/modules/try.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/try.lua b/xmake/core/sandbox/modules/try.lua index 3e21a39df..8a6771e4f 100644 --- a/xmake/core/sandbox/modules/try.lua +++ b/xmake/core/sandbox/modules/try.lua @@ -21,6 +21,7 @@ -- -- load modules +local utils = require("base/utils") local table = require("base/table") local string = require("base/string") local option = require("base/option") @@ -107,8 +108,11 @@ function sandbox_try.try(block) -- run the finally function if funcs and funcs.finally then - funcs.finally() + funcs.finally(utils.ifelse(ok, errors, nil)) end + + -- ok? + return utils.ifelse(ok, errors, nil) end -- return module |
