Pantry icon indicating copy to clipboard operation
Pantry copied to clipboard

Packing and unpacking should throw errors with informative messages

Open nickoneill opened this issue 9 years ago • 3 comments

nickoneill avatar Nov 04 '15 22:11 nickoneill

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 avatar Nov 06 '15 21:11 nickoneill

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?

nickoneill avatar Dec 09 '15 00:12 nickoneill

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.

andreamazz avatar Dec 09 '15 08:12 andreamazz