method break
Documentation for method break
assembled from the following types:
class Promise
From Promise
(Promise) method break
multi method break(Promise: \cause = False)
Breaks a promise, optionally setting the cause. If no cause is passed, the cause will be False
.
Throws an exception of type X::Promise::Vowed
if a vow has already been taken. See method vow
for more information.
my = Promise.new;.break('sorry');say .status; # OUTPUT: «Broken»say .cause; # OUTPUT: «sorry»