forked from Mirror/Ryujinx
Catch System.IO.IOException (#932)
This commit is contained in:
parent
45d86b8f6f
commit
d89e90a16e
1 changed files with 203 additions and 190 deletions
|
@ -85,6 +85,8 @@ namespace Ryujinx.Ui
|
|||
string saveDataPath = null;
|
||||
byte[] applicationIcon = null;
|
||||
|
||||
try
|
||||
{
|
||||
using (FileStream file = new FileStream(applicationPath, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
if ((Path.GetExtension(applicationPath).ToLower() == ".nsp") ||
|
||||
|
@ -94,6 +96,7 @@ namespace Ryujinx.Ui
|
|||
try
|
||||
{
|
||||
PartitionFileSystem pfs;
|
||||
|
||||
bool isExeFs = false;
|
||||
|
||||
if (Path.GetExtension(applicationPath).ToLower() == ".xci")
|
||||
|
@ -223,7 +226,7 @@ namespace Ryujinx.Ui
|
|||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Logger.PrintError(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
|
||||
Logger.PrintWarning(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
|
||||
Logger.PrintDebug(LogClass.Application, exception.ToString());
|
||||
|
||||
numApplicationsFound--;
|
||||
|
@ -282,7 +285,7 @@ namespace Ryujinx.Ui
|
|||
}
|
||||
catch
|
||||
{
|
||||
Logger.PrintError(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
|
||||
Logger.PrintWarning(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
|
||||
|
||||
numApplicationsFound--;
|
||||
|
||||
|
@ -309,7 +312,7 @@ namespace Ryujinx.Ui
|
|||
}
|
||||
catch
|
||||
{
|
||||
Logger.PrintError(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
|
||||
Logger.PrintWarning(LogClass.Application, $"The file encountered was not of a valid type. Errored File: {applicationPath}");
|
||||
|
||||
numApplicationsFound--;
|
||||
_loadingError = true;
|
||||
|
@ -327,6 +330,16 @@ namespace Ryujinx.Ui
|
|||
titleName = Path.GetFileNameWithoutExtension(applicationPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException exception)
|
||||
{
|
||||
Logger.PrintWarning(LogClass.Application, exception.Message);
|
||||
|
||||
numApplicationsFound--;
|
||||
_loadingError = true;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
ApplicationMetadata appMetadata = LoadAndSaveMetaData(titleId);
|
||||
|
||||
|
@ -384,7 +397,7 @@ namespace Ryujinx.Ui
|
|||
{
|
||||
Gtk.Application.Invoke(delegate
|
||||
{
|
||||
GtkDialog.CreateErrorDialog("One or more files encountered were not of a valid type, check logs for more info.");
|
||||
GtkDialog.CreateErrorDialog("One or more files encountered could not be loaded, check logs for more info.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue