-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
refactor(di): subclasses of BaseException should be immutable #2606
Comments
(I spoke with @vsavkin in person and he affirmed this approach) |
…#2606 Change AbstractBindingError constructor to take List<any> as keys Implement the AbstractBindingError.addKey(key) method to return a new AbstractBindingError Fix issue: refactor(di): subclasses of BaseException should be immutable angular#2606 BreakingChanges: AbstractBindingError constructor takes now List<any> as keys instead only one key.
…#2606 Change AbstractBindingError constructor to take List<any> as keys Implement the AbstractBindingError.addKey(key) method to return a new AbstractBindingError Fix issue: refactor(di): subclasses of BaseException should be immutable angular#2606 BreakingChanges: AbstractBindingError constructor takes now List<any> as keys instead only one key.
…#2606 Change AbstractBindingError constructor to take List<any> as keys Implement the AbstractBindingError.addKey(key) method to return a new AbstractBindingError Fix issue: refactor(di): subclasses of BaseException should be immutable angular#2606 BreakingChanges: AbstractBindingError constructor takes now List<any> as keys instead only one key.
I have tried to merge #2923 in. I have rebased on master, but realized that current implementation has an issue because it turns concrete exception (ie I have decided to abandon this since added code payload and constructor signature complexity does not justify the benefit of the immutability. Given that the exception are only mutated in DI, I see very little value in turning it into immutable code. Closing. |
…#2606 Change AbstractBindingError constructor to take List<any> as keys Implement the AbstractBindingError.addKey(key) method to return a new AbstractBindingError Fix issue: refactor(di): subclasses of BaseException should be immutable angular#2606 BreakingChanges: AbstractBindingError constructor takes now List<any> as keys instead only one key. Closes angular#2923
WONT_FIX |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
(Related to #2580 and #2570)
The
AbstractBindingError
class in di/exceptions extendsBaseException
from facade/lang, and provides anaddKey
method to append the error's message with more information. @yjbanov suggests (and I agree) that it would be better to implement the addKey method to return a newAbstractBindingError
, merging the input with the existing instance's message, to encourage/enforce immutability.(There may be other subclasses that need to change as well; I just wanted to get this issue open before I left the office).
@vsavkin, I'm happy to make this change if you're not opposed to this (since you're the one who's done the most work on di).
The text was updated successfully, but these errors were encountered: