Skip to content

Commit

Permalink
Merge #3128 Better message when ZipFile throws NotSupportedException
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Aug 2, 2020
2 parents 1d51afa + 3680e12 commit a0858d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.

- [Multiple] Purge CurlSharp (#3118 by: HebaruSan; reviewed: DasSkelett, techman83)
- [Core] Delete Authtoken when setting to null (#3119 by: Olympic1; reviewed: HebaruSan, DasSkelett)
- [Core] Better message when ZipFile throws NotSupportedException (#3128 by: HebaruSan; reviewed: DasSkelett)

### Internal

Expand Down
6 changes: 6 additions & 0 deletions Core/Net/NetFileCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@ public static bool ZipValid(string filename, out string invalidReason)
invalidReason = ex.Message;
return false;
}
catch (NotSupportedException nse) when (Platform.IsMono)
{
// SharpZipLib throws this if your locale isn't installed on Mono
invalidReason = $"{nse.Message}\r\n\r\nInstall the `mono-complete` package or equivalent for your operating system.";
return false;
}
}

/// <summary>
Expand Down

0 comments on commit a0858d6

Please sign in to comment.