Raise ResourceInvalidError for invalid shares