Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IsOfflineException to Handle new MAUI type for integers on iOS #43

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Float.Core.Tests/Float.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net7.0;net8.0;</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>9.0</LangVersion>
<UseMaui>true</UseMaui>
Expand All @@ -11,7 +11,7 @@
<PropertyGroup>
<CodeAnalysisRuleSet>../stylecop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net7.0'">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
4 changes: 2 additions & 2 deletions Float.Core.Tests/IEnumerator.tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void TestToDictionary()
new KeyValuePair<string, int>("third", 333)
};

var dict2 = dict1.ToDictionary();
var dict2 = IEnumerableExtensions.ToDictionary(dict1);

Assert.Equal(111, dict2["first"]);
Assert.Equal(222, dict2["second"]);
Expand Down Expand Up @@ -121,7 +121,7 @@ class TestClass1
{
}

class TestClass2: TestClass1
class TestClass2 : TestClass1
{
}

Expand Down
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
2 changes: 1 addition & 1 deletion Float.Core/Float.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2;net7.0;net8.0;</TargetFrameworks>
<AssemblyName>Float.Core</AssemblyName>
<AssemblyAuthor>Float</AssemblyAuthor>
<AssemblyDescription>Common utility code used by Float projects.</AssemblyDescription>
Expand Down
Loading