Closed haf closed 8 years ago
It should definitely return something non-empty! Giving a key might be tricky, as lenses are effectively opaque, so we don't know what element of the object was intended, but I'll come up with something...
Perhaps if you throw a typed exception instead of using 'failwith'? Or perhaps expose the error better?
Yeah that's a good suggestion, it's hard to give much more useful detail, due to the opacity, but at least a non-generic exception would help. (Saying that, if the error could even be thrown here, tryGetLensPartial is probably a better choice!) But I'll change this, as it's not good enough :)
Ping?
I'll pick this up and see what we can get in for 5.0 :)
There's some excellent new stuff on this in 6.0.0-rc4 onwards (courtesy of @neoeinstein - i'm not taking any credit for that), so I'll close this off.
returns an empty error message; it could possibly re-use they key to provide a nice error message "The property 'someKey' did not exist in the JSON structure".