Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezasamimi committed Oct 20, 2024
1 parent 54ec122 commit 9b60174
Show file tree
Hide file tree
Showing 248 changed files with 48 additions and 14 deletions.
6 changes: 6 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<!-- Disable CPM by default unless something already enabled it -->
<ManagePackageVersionsCentrally Condition="'$(ManagePackageVersionsCentrally)' != 'true'">false</ManagePackageVersionsCentrally>
</PropertyGroup>
</Project>
4 changes: 0 additions & 4 deletions Mohaymen.GiteaClient.sln.DotSettings.user

This file was deleted.

9 changes: 9 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<!-- Enable CPM for the project in this directory -->
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<!-- Import parent Directory.Build.props which respects the ManagePackageVersionsCentrally property already being set -->
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
</Project>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Mohaymen.GiteaClient.Core.ApiCall.Abstractions;
using Mohaymen.GiteaClient.Core.ApiCall.HttpHeader;
using Mohaymen.GiteaClient.Core.Configs;
using Mohaymen.GiteaClient.Core.Exceptions;
using Refit;

namespace Mohaymen.GiteaClient.Core.DependencyInjection;
Expand Down Expand Up @@ -35,6 +36,10 @@ public static IServiceCollection AddRefitClientTypes(this IServiceCollection ser
{
return null;
}
if (httpResponseMessage.StatusCode == System.Net.HttpStatusCode.Conflict)
{
throw new RepositoryAlreadyExistsException(await httpResponseMessage.Content.ReadAsStringAsync());
}
throw new Exception(await httpResponseMessage.Content.ReadAsStringAsync());
}
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace Mohaymen.GiteaClient.Core.Exceptions;

public class RepositoryAlreadyExistsException : Exception
{
public RepositoryAlreadyExistsException()
{
}

public RepositoryAlreadyExistsException(string message) : base(message)
{
}

public RepositoryAlreadyExistsException(string message, Exception innerException) : base(message, innerException)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection"/>
<PackageReference Include="Refit"/>
<PackageReference Include="Refit.HttpClientFactory"/>
<PackageReference Include="Refit.Newtonsoft.Json"/>
<PackageReference Include="Riok.Mapperly"/>
<PackageReference Include="Microsoft.Extensions.Options"/>
<PackageReference Include="Newtonsoft.Json"/>
<PackageReference Include="MediatR"/>
<PackageReference Include="FluentValidation"/>
<PackageReference Include="FluentValidation.DependencyInjectionExtensions"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Refit" />
<PackageReference Include="Refit.HttpClientFactory" />
<PackageReference Include="Refit.Newtonsoft.Json" />
<PackageReference Include="Riok.Mapperly" />
<PackageReference Include="Microsoft.Extensions.Options" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="MediatR" />
<PackageReference Include="FluentValidation" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" />
<PackageReference Include="PolySharp">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down

0 comments on commit 9b60174

Please sign in to comment.