Skip to content

Commit

Permalink
Fix IsOfflineException to Handle new MAUI type for integers on iOS (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
arctouch-alejandrovarela authored Jun 17, 2024
1 parent b7e00df commit c7c3d76
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Float.Core/Extensions/Exception.extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,18 @@ public static bool IsOfflineException(this Exception e)

if (code != null)
{
switch (Convert.ToInt64(code, new NumberFormatInfo()))
long convertedCode;

try
{
convertedCode = Convert.ToInt64(code, new NumberFormatInfo());
}
catch (InvalidCastException) when (code is nint parsedCode)
{
convertedCode = long.Parse(parsedCode.ToString());
}

switch (convertedCode)
{
// CannotFindHost
// CannotConnectToHost
Expand Down

0 comments on commit c7c3d76

Please sign in to comment.