exception fixes
This commit is contained in:
@@ -13,12 +13,10 @@
|
||||
<Platforms>AnyCPU</Platforms>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(Configuration) == 'Release'">
|
||||
<DocumentationFile>$(SolutionDir)\bin\$(Platform)\$(Configuration)\Torch.API.xml</DocumentationFile>
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="NLog" Version="4.7.13" />
|
||||
<PackageReference Include="SemanticVersioning" Version="2.0.0" />
|
||||
</ItemGroup>
|
||||
|
@@ -38,8 +38,10 @@ namespace Torch.API.WebAPI
|
||||
|
||||
public async Task<PluginItem> QueryOne(string guid)
|
||||
{
|
||||
return (PluginItem) await _client.GetFromJsonAsync(string.Format(PLUGIN_QUERY, guid), typeof(PluginItem),
|
||||
CancellationToken.None);
|
||||
using var res = await _client.GetAsync(string.Format(PLUGIN_QUERY, guid));
|
||||
if (!res.IsSuccessStatusCode)
|
||||
return null;
|
||||
return await res.Content.ReadFromJsonAsync<PluginItem>();
|
||||
}
|
||||
|
||||
public Task<bool> DownloadPlugin(Guid guid, string path = null)
|
||||
|
Reference in New Issue
Block a user