BetterCodable icon indicating copy to clipboard operation
BetterCodable copied to clipboard

Add failedDecodes to LossyArray

Open rnapier opened this issue 3 years ago • 3 comments

This is the beginning of an approach I'm considering regarding #41 to track failures. Rather than injecting logging into the system, it tracks failures such that you can check at the end if anything went wrong. I'm exploring whether I can use Mirror to scan a final data structure and collect all failures including in children. But I first wanted to pitch the basic approach and get any input.

I at least want to add this to the other Lossy types, and am considering how to best handle the Default types. Currently "default" is used both to mean "value when there is no value to avoid Optionals" and also "value when the data is corrupt to avoid throwing." IMO these are very different use cases, and I'm thinking through how to best split them up and make their differences explicit.

rnapier avatar Jul 17 '22 15:07 rnapier

I'm definitely into this idea. But you also have me scratching my chin at Default being an awkward solution that currently means both placeholder and error fallback. Definitely open to discussion here if you have more thoughts and ideas.

marksands avatar Jul 17 '22 21:07 marksands

Any reason why this PR was abandoned? Super useful to have, I need it 🤣 !

isadon avatar Mar 16 '23 19:03 isadon

@donileo sorry man, open source is hard 😓 . I want to do more with this project, but it's hard to muster the strength at times. I would be open to the idea of having a collaborator on this repo when life gets busy, for the right person of course. 🙏 thanks for your patience.

marksands avatar Mar 17 '23 16:03 marksands