diff --git a/QuantConnect.IEX/IEXDataProvider.cs b/QuantConnect.IEX/IEXDataProvider.cs index a8928b2..84928a6 100644 --- a/QuantConnect.IEX/IEXDataProvider.cs +++ b/QuantConnect.IEX/IEXDataProvider.cs @@ -394,7 +394,18 @@ public void SetJob(LiveNodePacket job) private void Initialize(string apiKey, string pricePlan) { _apiKey = apiKey; - var (requestPerSecond, maximumClients) = RateLimits[Enum.Parse(pricePlan, true)]; + + IEXPricePlan parsedPricePlan; + try + { + parsedPricePlan = Enum.Parse(pricePlan, true); + } + catch (Exception ex) + { + throw new Exception($"An error occurred while parsing the price plan '{pricePlan}'. Please ensure that the provided price plan is valid and supported by the system.", ex); + } + + var (requestPerSecond, maximumClients) = RateLimits[parsedPricePlan]; _rateGate = new RateGate(requestPerSecond, Time.OneSecond); _subscriptionManager = new EventBasedDataQueueHandlerSubscriptionManager();