Skip to content

Commit 52debf3

Browse files
committed
fix: try/catch local funcs
1 parent 799f2b0 commit 52debf3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

groupped-list.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ local jsonAggregates = cjson.decode(aggregates);
1313
local aggregateKeys = {};
1414
local result = {};
1515

16+
local function try(what)
17+
local status, result = pcall(what[1]);
18+
if not status then
19+
return what[2](result);
20+
end
21+
22+
return result;
23+
end
24+
25+
local function catch(what)
26+
return what[1]
27+
end
28+
1629
local function anynumber(a)
1730
return try {
1831
function()

0 commit comments

Comments
 (0)