• Kirill Smelkov's avatar
    decoder: Try to provide more explicit error context on invalid data (#29) · e4e61398
    Kirill Smelkov authored
    This partly reverts 572d0a6a and just changes %t -> %T so that printing
    does not enter infinite recursion and just print what we need: type of
    an object (%t is for true/false).
    
    Along the way I've added "pickle:" prefix to errors.
    
    In the future maybe it would make sense to create dedicated DecodeError
    which would contain position, current opcode, and error message itself.
    This way error reporting would be more structured and useful for users.
    e4e61398
ogorek.go 20.2 KB