Throw error messages when exception occurs while browsing an archive
This commit is contained in:
parent
6cc947b47e
commit
875b7b7caa
1 changed files with 26 additions and 13 deletions
|
@ -239,24 +239,37 @@
|
||||||
|
|
||||||
async Task<HashSet<FileManagerDirectory>> GetArchiveDirectoriesAsync(Guid archiveId)
|
async Task<HashSet<FileManagerDirectory>> GetArchiveDirectoriesAsync(Guid archiveId)
|
||||||
{
|
{
|
||||||
var entries = await ArchiveService.GetContents(archiveId);
|
try
|
||||||
var directories = new HashSet<FileManagerDirectory>();
|
|
||||||
|
|
||||||
var root = new FileManagerDirectory
|
|
||||||
{
|
{
|
||||||
Name = "Root",
|
var entries = await ArchiveService.GetContents(archiveId);
|
||||||
Path = "",
|
var directories = new HashSet<FileManagerDirectory>();
|
||||||
IsExpanded = true
|
|
||||||
};
|
|
||||||
|
|
||||||
root.PopulateChildren(entries);
|
var root = new FileManagerDirectory
|
||||||
|
{
|
||||||
|
Name = "Root",
|
||||||
|
Path = "",
|
||||||
|
IsExpanded = true
|
||||||
|
};
|
||||||
|
|
||||||
await ChangeDirectory(root, true);
|
root.PopulateChildren(entries);
|
||||||
|
|
||||||
return new HashSet<FileManagerDirectory>
|
await ChangeDirectory(root, true);
|
||||||
|
|
||||||
|
return new HashSet<FileManagerDirectory>
|
||||||
|
{
|
||||||
|
root
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException ex)
|
||||||
{
|
{
|
||||||
root
|
MessageService.Error("Could not open archive! Is it missing?");
|
||||||
};
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageService.Error("An unknown error occurred trying to open the archive");
|
||||||
|
}
|
||||||
|
|
||||||
|
return new HashSet<FileManagerDirectory>();
|
||||||
}
|
}
|
||||||
|
|
||||||
string GetEntryName(IFileManagerEntry entry)
|
string GetEntryName(IFileManagerEntry entry)
|
||||||
|
|
Loading…
Add table
Reference in a new issue