decode: more informative error messages