mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
feat(lib): handle errors inside invoking resource
Make the source of the error more apparent.
This commit is contained in:
1 parent
340ca48012
commit
7496cf0400
1 file changed
+5
-1
+5
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user