treeform/jsony

better exception handing

salva-imm opened this issue · 2 comments

Hey
i wonder if there's way to just throw better exception , with field/type name

example:

type Entry1 = object
  username: string
  password: string

serializing this: "username":true it just tells me : e: Expected " but got t instead. At offset: 17
expected result: Wrong type: username should be string
obviously I don't want to check everything manually..

I would like better exception handler. But to produce nicer errors more state needs to be passed around. That will sacrifice speed though, I don't want to sacrifice speed.

maybe better exceptions could only be enabled in debug mode?