I have a suspicion Js.Json must be semi-deprecated (bs-json is probably the way to go), but I tried to decode JSON the way it’s done in an example there and now I have questions regarding errors in general.
-
Should we use
failwithat all? Seems like some Caml pervasive, and I’ve got no idea how to catch it, so I’ve ended up usingJs.Exn.raiseTypeErroranyway. -
Isn’t
Belt.Resultmeant for error handling? Of course it would meanflatMapseverywhere so maybe that’s not the recommended style, but as a user, I’d like to know the recommended style.
.