better error messages for typescript