Encoder: Use javascript TypeError
Encoder: throw if type information is not valid