Reraise an error when object is invalid