Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants