Decodable icon indicating copy to clipboard operation
Decodable copied to clipboard

[WIP] Error formatter

Open Anviking opened this issue 7 years ago • 1 comments

The implementation is hideous, but it appears to work.

object: 
 | repo: 
 |  | owner:  <<<<---- MissingKey: oops
 |  |  | id: 1
 |  |  | login: "anviking"

ATM, | characters appear in the parent nodes of the error to make it easier to locate.

This is probably ready when

  • [ ] Array error back propagation works (KeyPath needs to support array indexes) (?)
  • [ ] Implementation is less less hideous
  • [ ] Style of errors has been tweaked

Anviking avatar Sep 19 '16 23:09 Anviking

Also, out of scope for this but if operators are discarded for global functions decode(json, keys...) tracking function name, filename etc. the possibilities just become so ridiculous that I'm not even sure I want to do it ever. In debug mode each json object could have information about which decode function accessed it, which we could color code and present as a HTML representation. This would also draw attention to json keys not accessed that should be == win.

Anviking avatar Sep 19 '16 23:09 Anviking