rescript-labs / decco

Bucklescript PPX which generates JSON (de)serializers for user-defined types
MIT License
226 stars 27 forks source link

Default path to Pervasives.__LOC__ in generated code. #54

Open erlandsona opened 4 years ago

erlandsona commented 4 years ago

We use Decco at work and recently ran into a situation where we we're trying to track down a decode failure before pushing some code to prod and given the {path: "", ...} was hardcoded to an empty string made it incredibly difficult to track down the source of the error.

If we could instead default to Pervasives.__LOC__ this would have been very easy to track down as the error would've pointed to the exact file and line number of the failure. Or at least in principle. Even if the line number is off by one or something just knowing the file of the source where the decode is failing would be immensely helpful.