i tried to make thread with using module “promise”, but it said the errors.
function Move()
print("using!")
task.wait(3)
print("used!")
end
local MovePromise
MovePromise = Promise.new(function(resolve, reject, onCancel)
local Succ, Err = xpcall(Move, debug.traceback)
if not Succ then
reject(Err)
end
resolve()
end):catch(warn)
task.wait(1)
MovePromise:Cancel()
From the stack trace I see you are using Sleitnick’s Signal. With the given code and without more context, I cannot seem to reproduce the error.
However, there are two things to be changed in the snippet. Promise:cancel() is only supported in lower case, and promises already safely catch errors. For uncontrolled rejections, the traceback is passed into the rejection handler automatically.