-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using PMKError.cancelled unexpectedly (to a newbie) stops chain from completing. Document somehow?? #1259
Comments
v7 docs seem to have both made cancelization incredibly complex and also made the docs unreadable. So, yeah this could be improved. Sadly I don't really understand how cancellation works anymore. @dougzilla32 can maybe explain. Whatever the cancellation documentation is now intimidating and does not actually emphasize the fact canceled errors are by default not caught. Which IMO is a serious step backwards in our quality. |
Cancelation is neither success nor failure. Hence this behavior. Instead use a Considering I don't really understand how it works I'm not sure we should recommend v7 at this point. Maintaining this library is not well paid (~1K a year in donations), so considering the thousands of hours I have spent on it previously, it is hard to justify time on it nowadays that I have a family to take care of and my time should be paid. |
understood - and thanks for your work! re cancellation, perhaps one for @dougzilla32 - could PromiseKit print a debug error if a promise isn't explicitly cancellable, but returns PMKError.cancelled ? |
ok - just tested with 6.15.3 and the behaviour is the same. I'll reopen my doc pull requests! |
Yeah we really should print a debug message, this catches people, no pun intended. |
Hello @ConfusedVorlon |
Hi - years have passed. I no longer have any insight here... |
7.0.0.rc2
installed with SPM
I created a promise wrapper for NSAlert.
It seemed sensible to use
seal.reject(PMKError.cancelled)
in the case where the user clicked 'cancel'I didn't realise that this error has a special-case treatment where the
.catch
block isn't called.Presumably there isn't a good 'code' way to warn about this - but it could be flagged in the troubleshooting section under 'My promise never resolves'
Example below. To me, it was very surprising that neither the .done nor the .catch block were called
The text was updated successfully, but these errors were encountered: