Skip to content
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

Add safe helpers for retrieval, preventing KeyNotFoundException #16

Open
hanssens opened this issue Mar 1, 2017 · 2 comments
Open

Add safe helpers for retrieval, preventing KeyNotFoundException #16

hanssens opened this issue Mar 1, 2017 · 2 comments

Comments

@hanssens
Copy link
Owner

hanssens commented Mar 1, 2017

E.g. TryGet() and TryQuery().

@n-alex-white
Copy link

I presume this is to resolve the kind of problem which I've just seen, where I received a "Could not find key 'xyz' in the LocalStorage" exception when I attempted a Get for a key which wasn't yet populated.

I was reading your instructions and couldn't spot how I ought to be checking for a key before I attempt to get it. Is there a process which I should be using that I'm missing?

Cheers

@hanssens
Copy link
Owner Author

@n-alex-white Indeed. I'll be adding these operations in the upcoming version. I'm also contemplating about an additional Exists() method for the sole purpose of readability (e.g. code eloquence if you will).

ETA for the updated version is this month. Hope you can wait for this.

@hanssens hanssens changed the title Add safe helpers for retrieval Add safe helpers for retrieval, preventing KeyNotFoundException Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants