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

Exception Handling #38

Closed
wapacro opened this issue Dec 17, 2019 · 3 comments
Closed

Exception Handling #38

wapacro opened this issue Dec 17, 2019 · 3 comments
Assignees

Comments

@wapacro
Copy link
Contributor

wapacro commented Dec 17, 2019

We recently ran into issues when saving items which are too large or which cause the storage space to exceed the quota in total. Since the set method catches any exceptions and just prints them there is not really an easy way to handle these cases.

It'd therefore be great if the library could just throw the exceptions so the developer has access to it and could handle it using try {} catch(e) {}.

I would be happy to provide another pull request but I quickly wanted to check what implementation you would prefer. In my opinion we could simply add a new setting throwExceptions: true which by default is false. This prevents any breaking changes.

If the setting is true simply throw any exceptions; if not just print it to the console like it's done today. Or would you rather completely switch to throwing exceptions?

@yarkovaleksei
Copy link
Owner

It would be better to throw an exception than just writing to the console. Initially, I made a mistake when I did not take this into account. Parameter is not needed. You just need to add error handling.

@yarkovaleksei yarkovaleksei self-assigned this Dec 21, 2019
@yarkovaleksei
Copy link
Owner

yarkovaleksei commented Dec 21, 2019

@wapacro Done in version 5.0.0!

@wapacro
Copy link
Contributor Author

wapacro commented Dec 22, 2019

Great, thank you @yarkovaleksei 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants