diff --git a/Common/Data/DataMonitor.cs b/Common/Data/DataMonitor.cs
index e623f3613cbd..69181647736f 100644
--- a/Common/Data/DataMonitor.cs
+++ b/Common/Data/DataMonitor.cs
@@ -85,7 +85,7 @@ public void OnNewDataRequest(object sender, DataProviderNewDataRequestEventArgs
var isUniverseData = path.Contains("coarse", StringComparison.OrdinalIgnoreCase) ||
path.Contains("universe", StringComparison.OrdinalIgnoreCase);
- if (e.Succeded)
+ if (e.Succeeded)
{
WriteLineToFile(_succeededDataRequestsWriter, path, _succeededDataRequestsFileName);
Interlocked.Increment(ref _succeededDataRequestsCount);
@@ -105,7 +105,7 @@ public void OnNewDataRequest(object sender, DataProviderNewDataRequestEventArgs
if (Logging.Log.DebuggingEnabled)
{
- Logging.Log.Debug($"DataMonitor.OnNewDataRequest(): Data from {path} could not be fetched");
+ Logging.Log.Debug($"DataMonitor.OnNewDataRequest(): Data from {path} could not be fetched, error: {e.ErrorMessage}");
}
}
}
diff --git a/Common/Interfaces/DataProviderDataFetchedEventArgs.cs b/Common/Interfaces/DataProviderDataFetchedEventArgs.cs
index 8124eff54369..bf3e04315b9d 100644
--- a/Common/Interfaces/DataProviderDataFetchedEventArgs.cs
+++ b/Common/Interfaces/DataProviderDataFetchedEventArgs.cs
@@ -30,17 +30,24 @@ public class DataProviderNewDataRequestEventArgs : EventArgs
///
/// Whether the data was fetched successfully
///
- public bool Succeded { get; }
+ public bool Succeeded { get; }
+
+ ///
+ /// Any error message that occurred during the fetch
+ ///
+ public string ErrorMessage { get; }
///
/// Initializes a new instance of the class
///
/// The path to the fetched data
- /// Whether the data was fetched successfully
- public DataProviderNewDataRequestEventArgs(string path, bool succeded)
+ /// Whether the data was fetched successfully
+ /// Any error message that occured during the fetch
+ public DataProviderNewDataRequestEventArgs(string path, bool succeeded, string errorMessage)
{
Path = path;
- Succeded = succeded;
+ Succeeded = succeeded;
+ ErrorMessage = errorMessage;
}
}
}
diff --git a/Engine/DataFeeds/DefaultDataProvider.cs b/Engine/DataFeeds/DefaultDataProvider.cs
index eaa778052985..6dca05897a08 100644
--- a/Engine/DataFeeds/DefaultDataProvider.cs
+++ b/Engine/DataFeeds/DefaultDataProvider.cs
@@ -24,6 +24,8 @@ namespace QuantConnect.Lean.Engine.DataFeeds
///
public class DefaultDataProvider : IDataProvider, IDisposable
{
+ private bool _oneTimeWarningLog;
+
///
/// Event raised each time data fetch is finished (successfully or not)
///
@@ -37,6 +39,7 @@ public class DefaultDataProvider : IDataProvider, IDisposable
public virtual Stream Fetch(string key)
{
var success = true;
+ var errorMessage = string.Empty;
try
{
return new FileStream(FileExtension.ToNormalizedPath(key), FileMode.Open, FileAccess.Read, FileShare.Read);
@@ -44,8 +47,17 @@ public virtual Stream Fetch(string key)
catch (Exception exception)
{
success = false;
- if (exception is DirectoryNotFoundException
- || exception is FileNotFoundException)
+ errorMessage = exception.Message;
+ if (exception is DirectoryNotFoundException)
+ {
+ if (!_oneTimeWarningLog)
+ {
+ _oneTimeWarningLog = true;
+ Logging.Log.Debug($"DefaultDataProvider.Fetch(): DirectoryNotFoundException: please review data paths, current 'Globals.DataFolder': {Globals.DataFolder}");
+ }
+ return null;
+ }
+ else if (exception is FileNotFoundException)
{
return null;
}
@@ -54,7 +66,7 @@ public virtual Stream Fetch(string key)
}
finally
{
- OnNewDataRequest(new DataProviderNewDataRequestEventArgs(key, success));
+ OnNewDataRequest(new DataProviderNewDataRequestEventArgs(key, success, errorMessage));
}
}