forked from EllieBotDevs/elliebot
.yml config load errors will now show which file failed and why
This commit is contained in:
parent
b033b062a5
commit
eb808d00e5
1 changed files with 9 additions and 1 deletions
|
@ -74,7 +74,15 @@ public abstract class ConfigServiceBase<TSettings> : IConfigService
|
|||
Save();
|
||||
}
|
||||
|
||||
data = _serializer.Deserialize<TSettings>(File.ReadAllText(_filePath));
|
||||
try
|
||||
{
|
||||
data = _serializer.Deserialize<TSettings>(File.ReadAllText(_filePath));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Error while loading {ConfigFilePath}", _filePath);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Reference in a new issue