-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
DialogCancelError - class or interface? #323
Comments
The reason we used an |
Ohhhh... that! |
@thinkOfaNumber do you think it can be closed? |
It would be nice to move away from duck-typing, but I have no idea how error subclassing issues would affect other users of the framework! Given this is just my opinion and it's been "noted", then yes, I'll close 👍 |
For me this issue is complementary to #328. |
from the dialog service I am opening the popup , but on close we have to open some validation popup . how to do that on close action from dialog service |
I'm submitting a feature request
aurelia-dialog 1.0.0-rc.1.0.3
(I think the other bug template questions don't apply to a feature request but I can provide if required)
I'm using aurelia-dialog to confirm an action that gets posted to the server to change some object. It seems using
rejectOnCancel
is a good way to skip over the promise chain that deals with successfully changing the object. In thecatch
handler I need to differentiate between the respectiveDialogCancelError
or some other error (e.g. from thehttpClient
).Because DialogCancelError is an interface and not a class, I can't use the simple pattern to detect the type of error:
Instead I have to use some sort of duck-typing.
My feature request (and I could create a PR if someone likes the idea) is to use a class instead so that I can use the pattern above.
If there's a better way of doing this, please let me know! I would rather not set
rejectOnCancel: false
because it's a very neat way of skipping the rest of the promise chain which would otherwise require passing and checking this cancel state through eachthen()
method:The text was updated successfully, but these errors were encountered: