mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Upgrading from v5.x to v6.x #268
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tosbaha on GitHub (Apr 24, 2019).
Hi,
I would like to upgrade the library in my project. I saw it has breaking changes. Is it safe to use
try?it like below?Old Code
New Code
@JohnEstropia commented on GitHub (Apr 26, 2019):
Fetches are now
throwing functions to separate these two cases:nilreturn: When there is no result to returnaddStorage()completed, or the entity fetched is not in the schema.Wether
try?in your code is ok depends on how you were using it before. If you wish to ignore cases where your DataStack is still setting up its storage, you can usetry?and handlenilcases as you have before.But if your code expects that this fetch happens after
addStorage(), I would encourage you to handle the thrown error instead. Or if you are really, really sure, usetry!.@tosbaha commented on GitHub (Apr 27, 2019):
Thanks for the answer. From your comments, it sounds like using try? is same way I was using in previous version. Because I was handling
nilcase. I don't need to handle DataStack being setup.