copy model of catching encoding errors from darmok