mirror of https://github.com/ppy/osu
Handle exception thrown due to custom stoage on startup
This commit is contained in:
parent
ab15b6031d
commit
cdcad94e9f
|
@ -34,7 +34,17 @@ public OsuStorage(GameHost host, Storage defaultStorage)
|
||||||
var customStoragePath = storageConfig.Get<string>(StorageConfig.FullPath);
|
var customStoragePath = storageConfig.Get<string>(StorageConfig.FullPath);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(customStoragePath))
|
if (!string.IsNullOrEmpty(customStoragePath))
|
||||||
ChangeTargetStorage(host.GetStorage(customStoragePath));
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ChangeTargetStorage(host.GetStorage(customStoragePath));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Log($"Couldn't use custom storage path ({customStoragePath}): {ex}. Using default path.", LoggingTarget.Runtime, LogLevel.Error);
|
||||||
|
ChangeTargetStorage(defaultStorage);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ChangeTargetStorage(Storage newStorage)
|
protected override void ChangeTargetStorage(Storage newStorage)
|
||||||
|
|
Loading…
Reference in New Issue