feat(lib): handle errors inside invoking resource

Make the source of the error more apparent.
This commit is contained in:
Linden committed 2022-06-04 14:54:20 +10:00
1 parent 340ca48012
commit 7496cf0400
1 file changed
+5 -1
+5 -1
View File
@@ -68,7 +68,11 @@ local GetCurrentResourceName = GetCurrentResourceName()
local function await(fn, query, parameters)
local p = promise.new()
fn(nil, query, parameters, function(result)
fn(nil, query, parameters, function(result, error)
if error then
return p:reject(error)
end
p:resolve(result)
end, GetCurrentResourceName)
return Await(p)