From 7fb09d103f4a680cbd61d5348ec9c5d50244a8e0 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Fri, 20 Apr 2018 23:25:23 -0700 Subject: [PATCH] Update to Promise version from Rojo, which changes await() --- lib/init.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/init.lua b/lib/init.lua index cdcea79..144469e 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -221,15 +221,11 @@ function Promise:await() local ok = bindable.Event:Wait() bindable:Destroy() - if not ok then - error(tostring(result[1]), 2) - end - - return unpack(result) + return ok, unpack(result) elseif self._status == Promise.Status.Resolved then - return unpack(self._value) + return true, unpack(self._value) elseif self._status == Promise.Status.Rejected then - error(tostring(self._value[1]), 2) + return false, unpack(self._value) end end