-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Duplicate model exception cannot be caught #976
Comments
Hi @khiltd! The reason your error isn't being caught is because |
Makes perfect sense technically, but I'd argue that that's not a great design choice as it forces such error checking into an extremely unnatural location no one is going to remember two weeks later. Why can't you simply refrain from inserting that bothersome object and |
Ran into the same thing when adding an array of models. While I like that collections are now unique it's problematic when adding items without overriding the add method, which is what we had to do before anyway for unique collections. It'd be nice if it just failed silently if there was a duplicate. |
Looks like we're all set, vis-a-vis this ticket. Duplicate model additions are now a no-op on master. |
In addition to being unreadable, the following conditional will halt all script execution in the event that it tests positive and doesn't seem to be caught by a
try
block.While it's certainly a problem if this ever hits, I'd really prefer it if it didn't crash my entire application as a result.
The text was updated successfully, but these errors were encountered: