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

Packing and unpacking should throw errors with informative messages #5

Open
nickoneill opened this issue Nov 4, 2015 · 3 comments
Open

Comments

@nickoneill
Copy link
Owner

No description provided.

@nickoneill
Copy link
Owner Author

Some things to think about:

  • Should pack with some property that isn't supported throw an error?
  • Should unpack when a mismatch exists (property with no stored key? extra key that doesn't correspond to a property) throw an error?

@nickoneill
Copy link
Owner Author

I'm actually not 100% on this throwing errors to the end user anymore. Is there a high enough chance of failure that we should make everyone jump through the error checking loop every time they want to store or retrieve data?

@andreamazz
Copy link
Collaborator

It might be worth throwing when packing, since it's pretty important to ensure that the user knows that the data will not be available in the future.
For the unpack returning an optional should suffice, and it would make the retrieval less of a burden for the user.

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