Giter VIP home page Giter VIP logo

tencentcloud-sdk-dotnet's Issues

检验captcha ticke包 NoSuchVersion错误

code:NoSuchVersion message:The specified api version=2019-07-22 does not exist in service=tms. "

这个是什么意思?服务端不支持这个版本?

引用的程序集namespace为
image

使用的是 TencentCloudSDK.Captcha Version 3.0.171

CapatchaClient
Endpoint: tms.tencentcloudapi.coim
Region: ap-shanghai

Strong name

Referenced assembly 'TencentCloud, Version=3.0.27.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.

vs2017下依赖项安装不成功,依赖环境问题,辛苦增加描述

依赖环境:.NET Framework 4.5+ 和 .NET Core 2.1。
首先,这里的依赖环境我已经通过vs2017安装器,修改了对应的依赖项。
然后,使用git clone 下载源码,使用Nuget 的命令安装TencentCloudSDK。
这次我要使用dotnet-sdk,但是遇到了这个问题,控制台一直跑不起来。
错误代码提示如下:
第一个bug
严重性 代码 说明 项目 文件 行 禁止显示状态 错误 The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.1. TencentCloudExamples D:\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets 112
第二个bug
严重性 代码 说明 项目 文件 行 禁止显示状态 错误 The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0. TencentCloud D:\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets 126
再然后,我通过Nuget安装也不成功,我尝试几次,都得到如下错误
`PM> Install-Package TencentCloudSDK -version 3.0.0
正在还原 E:\code\tencentcloud-sdk-dotnet\TencentCloud\TencentCloud.csproj 的包...
Install-Package : NU1108: 检测到循环。
TencentCloudSDK -> TencentCloudSDK (>= 3.0.0).
所在位置 行:1 字符: 1

  • Install-Package TencentCloudSDK -version 3.0.0
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
      + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCm 
     dlets.InstallPackageCommand
    
    

Install-Package : 程序包还原失败。正在回滚“TencentCloud”的程序包更改。
所在位置 行:1 字符: 1

  • Install-Package TencentCloudSDK -version 3.0.0
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
      + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCm 
     dlets.InstallPackageCommand
    
    

已用时间: 00:00:00.8410410
PM> Install-Package TencentCloudSDK -version 3.0.44
正在还原 E:\code\tencentcloud-sdk-dotnet\TencentCloud\TencentCloud.csproj 的包...
Install-Package : NU1108: 检测到循环。
TencentCloudSDK -> TencentCloudSDK (>= 3.0.44).
所在位置 行:1 字符: 1

  • Install-Package TencentCloudSDK -version 3.0.44
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
      + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCm 
     dlets.InstallPackageCommand
    
    

Install-Package : 程序包还原失败。正在回滚“TencentCloud”的程序包更改。
所在位置 行:1 字符: 1

  • Install-Package TencentCloudSDK -version 3.0.44
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
      + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCm 
     dlets.InstallPackageCommand
    
    

已用时间: 00:00:00.5515549
PM> `

最后,我通过命令行安装依赖项,dotnet add package TencentCloudSDK --version 3.0.0,得到如下错误,请问这是什么原因呢?
`C:\Users>dotnet add package TencentCloudSDK --version 3.0.0

欢迎使用 .NET Core 3.1!

SDK 版本: 3.1.100

遥测

.NET Core 工具收集使用数据,以帮助我们改善你的体验。数据是匿名的。它由 Microsoft 收集并与社区共享。你可以通过使用喜欢的 shell 将 DOTNET_CLI_TELEMETRY_OPTOUT 环境变量设置为 "1" 或 "true" 来选择退出遥测。

阅读有关 .NET Core CLI 工具遥测的更多信息: https://aka.ms/dotnet-cli-telemetry


查看文档: https://aka.ms/dotnet-docs
通过 GitHub 报告问题和查找源: https://github.com/dotnet/core
查找最新功能: https://aka.ms/dotnet-whats-new
了解已安装的 HTTPS 开发者证书: https://aka.ms/aspnet-core-https
使用 "dotnet --help" 查看可用命令或访问: https://aka.ms/dotnet-cli-docs
编写你的第一个应用: https://aka.ms/first-net-core-app

“C:\Users\p_yingfalu\”中找不到任何项目。
用法: dotnet add package [选项] <PACKAGE_NAME>

参数:
要操作的项目文件。如果未指定文件,则命令会在当前目录下搜索一个文件。
<PACKAGE_NAME> 要添加的包引用。

选项:
-h, --help 显示命令行帮助。
-v, --version 要添加的包版本。
-f, --framework 仅针对特定框架添加引用。
-n, --no-restore 在没有执行还原预览和兼容性检查的情况下添加引用。
-s, --source 要在还原期间使用的 NuGet 包源。
--package-directory <PACKAGE_DIR> 要将包还原到其中的目录。
--interactive 允许命令停止和等待用户输入或操作(例如,用以完成身份验证)。
`
不清楚项目的每个依赖之间具体是什么关系。

Unable to install package TencentCloudSDK 3.0.770

Unable to install package TencentCloudSDK 3.0.770
System.IO.InvalidDataException: End of Central Directory record could not be found.
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory () [0x0002c] in <893b20abc59547dc8b2fd41a7233777e>:0
at System.IO.Compression.ZipArchive.Init (System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode, System.Boolean leaveOpen) [0x001c8] in <893b20abc59547dc8b2fd41a7233777e>:0
at System.IO.Compression.ZipArchive..ctor (System.IO.Stream stream, System.IO.Compression.ZipArchiveMode mode, System.Boolean leaveOpen, System.Text.Encoding entryNameEncoding) [0x0001c] in <893b20abc59547dc8b2fd41a7233777e>:0
at System.IO.Compression.ZipFile.Open (System.String archiveFileName, System.IO.Compression.ZipArchiveMode mode, System.Text.Encoding entryNameEncoding) [0x0005b] in <21010871e8cb4079b5e9593dc3e69066>:0
at System.IO.Compression.ZipFile.Open (System.String archiveFileName, System.IO.Compression.ZipArchiveMode mode) [0x00000] in <21010871e8cb4079b5e9593dc3e69066>:0
at System.IO.Compression.ZipFile.OpenRead (System.String archiveFileName) [0x00000] in <21010871e8cb4079b5e9593dc3e69066>:0
at NugetForUnity.NuspecFile.FromNupkgFile (System.String nupkgFilepath) [0x0000e] in <6e0120d8e26943c7a6cc9002e28bf9c8>:0
at NugetForUnity.NugetPackage.FromNupkgFile (System.String nupkgFilepath) [0x00000] in <6e0120d8e26943c7a6cc9002e28bf9c8>:0
at NugetForUnity.NugetHelper.GetCachedPackage (NugetForUnity.NugetPackageIdentifier packageId) [0x00053] in <6e0120d8e26943c7a6cc9002e28bf9c8>:0
at NugetForUnity.NugetHelper.GetSpecificPackage (NugetForUnity.NugetPackageIdentifier packageId) [0x00010] in <6e0120d8e26943c7a6cc9002e28bf9c8>:0
at NugetForUnity.NugetHelper.InstallIdentifier (NugetForUnity.NugetPackageIdentifier package, System.Boolean refreshAssets) [0x0001f] in <6e0120d8e26943c7a6cc9002e28bf9c8>:0
at NugetForUnity.NugetHelper.Install (NugetForUnity.NugetPackage package, System.Boolean refreshAssets) [0x001fc] in <6e0120d8e26943c7a6cc9002e28bf9c8>:0
UnityEngine.Debug:LogErrorFormat (string,object[])
NugetForUnity.NugetHelper:Install (NugetForUnity.NugetPackage,bool)
NugetForUnity.NugetHelper:InstallIdentifier (NugetForUnity.NugetPackageIdentifier,bool)
NugetForUnity.NugetWindow:DrawPackage (NugetForUnity.NugetPackage,UnityEngine.GUIStyle,UnityEngine.GUIStyle)
NugetForUnity.NugetWindow:DrawPackages (System.Collections.Generic.List`1<NugetForUnity.NugetPackage>)
NugetForUnity.NugetWindow:DrawOnline ()
NugetForUnity.NugetWindow:OnGUI ()
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

.NET 4.6.1请求一直在请求中

我通过NuGet下载的3.0.37版本的sdk,在.NET4.6.1的版本中请求OCR是一直请求中,也不会报错,而在4.8的framework和core3.0中不会出现这种情况,请问是什么问题?我请求的地址是ocr.tencentcloudapi.com区域是:ap-beijing

asp.net web api 使用sdk报错

未能加载文件或程序集“Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)

TencentCloudSDK 3.0.0 依赖 Newtonsoft.Json (>= 11.0.1)

在项目中引用'TencentCloudSDK 3.0.0 时,sdk依赖 Newtonsoft.Json (>= 11.0.1),但我的项目中依赖的是低版本“Newtonsoft.Json 7.0.1”,由于某种原因无法将本项目中的 Newtonsoft.Json 升级到高版本,在这种情况下考虑降低TencentCloudSDK依赖的Newtonsoft.Json 版本,TencentCloudSDK依赖的Newtonsoft.Json 版本必须要>= 11.0.1吗?该如何处理??

对象存储

什么时候添加对对象存储的支持? 不想自己写了,但是发现该项目中没有对对象存储的支持

有个会造成程序无限等待的低级bug

在TencentCloud.Common.Http.HttpConnection类的107行,使用的方法“AsResponse”,在WINFROM和控制台下可以正常请求,但在.net framework的站点(mvc or webapi)下会导致程序无限等待。
改成.GetAwaiter().GetResult()即可。

可以提供依赖注入相关的说明吗?

我在做腾讯云点播,如果把VodClient以单例方式注入到ioc会有我问题吗?
希望提供更多ioc相关集成说明

另外我通过nuget包安装的,所有的api包括模型属性都没有注释,可以加上吗

接口异常时建议

当接口返回错误时希望能够直接返回详细的错误结果信息实体,也就是code和message,而不是抛出异常!

图片到了740KB左右就会报错

如题,图片到了740KB左右就会报错,但是官网上说是3M,我的请求时间也没有超过3s,请问一下是什么问题?异常信息是:Message:code:AuthFailure.SignatureFailure message:The provided credentials could not be validated because of exceeding request size limit, please use new signature method TC3-HMAC-SHA256. 我使用的就是TC3-HMAC-SHA256这种加密方式

FluentClient IDisposable

FluentClient : IClient, IDisposable
FluentClient 调用了非托管资源,是需要IDisposable回收的。但目前的HttpConnection.cs代码只管new FluentClient,根本没有回收资源。

support .net core3 ?

user feedback:

您好,我想咨询一下,目前.net core3的预览版已经发布到9了。正式版也会在9月底发布,但我们这腾讯云文档才显示支持到2.1。连2.2版本好像都没说支持。我目前正在基于netcore开发网络服务。但到时候腾讯云会尽快的给与netcore对应版本的支持么?或者说有什么对应的支持时间表么?

TencentCloud.Tmt.V20180321.Models.TextTranslateRequest中需要增加UntransaltedText 属性

///


/// 排除不需要翻译的文本
///

[JsonProperty("UntranslatedText")]
public string UntranslatedText { get; set; }

    /// <summary>
    /// 内部实现,用户禁止调用
    /// </summary>
    internal override void ToMap(Dictionary<string, string> map, string prefix)
    {
        this.SetParamSimple(map, prefix + "SourceText", this.SourceText);
        this.SetParamSimple(map, prefix + "Source", this.Source);
        this.SetParamSimple(map, prefix + "Target", this.Target);
        this.SetParamSimple(map, prefix + "ProjectId", this.ProjectId);
        this.SetParamSimple(map, prefix + "UntranslatedText", this.UntranslatedText);
    }

希望把nuget中sdk库加上强签名

您好,我们的很多.netframework项目都使用了强签名,在依赖你们公共的nuget库中的sdk时,发现sdk库没有强签名,导致无法引用,只能把你们的代码clone一份加上强签名重新编译。这个动作实在多余,徒增维护成本,官方能否重视处理一下这个问题。

Heartbeat took longer than "00:00:01"

image

大规模的 TextTranslate 请求会造成线程池饥渴,耗尽资源。提议所有异步方法都使用CancellationToken参数。在外部环境有异常的时候能够手动cancel所有请求。
Task<TextTranslateResponse> TextTranslate(TextTranslateRequest req, CancellationToken cancel);

或者由SDK外部提供HttpClient,这样用户可以在.net core中使用Polly等弹性故障处理方式。
https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/implement-resilient-applications/implement-http-call-retries-exponential-backoff-polly

Proxy Authentication Failed

The example of sending sms Here shows we can specify web proxy, but it is of string type. How could I authenticate my proxy then?

httpProfile.WebProxy = "WEB_PROXY";

Float类型精度问题

com.tencentcloudapi.cat.v20180409.models.Field#value字段为Float类型,接受时间戳数据存在精度丢失。希望能够解决

sdk在linux下,会发生ssl无法连接的错误

错误消息:”The request with exception: The SSL connection could not be established"

目前使用以下代码跳过验证,但经过测试,baidu的sdk能绕过了,但腾讯的sdk没有办法绕过。
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, errors) =>
{
Console.WriteLine("on ServerCertificateValidationCallback");
return true;
};

服务器版本:ubuntu 16.04
.net 版本: .net core 3.1

使用sdk遇到MissingMethodException

使用sdk查询cvm实例遇到sdk内部错误提示Method not found
dotnet 环境如下

.NET Core SDK (reflecting any global.json):
 Version:   3.1.300
 Commit:    b2475c1295
Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.15
 OS Platform: Darwin
 RID:         osx.10.15-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.1.300/

paket管理依赖,其中paket.lock如下

STORAGE: NONE
RESTRICTION: || (== netcoreapp3.1) (== netstandard2.0) (== netstandard2.1)
NUGET
  remote: https://api.nuget.org/v3/index.json
    FSharp.Core (4.7.2)
    Microsoft.AspNet.WebApi.Client (5.2.7)
      Newtonsoft.Json (>= 10.0.1)
      Newtonsoft.Json.Bson (>= 1.0.1)
    Newtonsoft.Json (12.0.3)
    Newtonsoft.Json.Bson (1.0.2)
      Newtonsoft.Json (>= 12.0.1)
    Pathoschild.Http.FluentClient (4.0)
      Microsoft.AspNet.WebApi.Client (>= 5.2.7)
    System.Buffers (4.5.1) - restriction: || (&& (== netcoreapp3.1) (>= monoandroid)) (&& (== netcoreapp3.1) (>= monotouch)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netstandard1.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (>= uap10.1)) (&& (== netcoreapp3.1) (>= xamarinios)) (&& (== netcoreapp3.1) (>= xamarinmac)) (&& (== netcoreapp3.1) (>= xamarintvos)) (&& (== netcoreapp3.1) (>= xamarinwatchos)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) (&& (== netstandard2.1) (>= uap10.1))
    System.Memory (4.5.4) - restriction: || (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.1) (< netstandard2.1)) (&& (== netcoreapp3.1) (>= uap10.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) (&& (== netstandard2.1) (>= uap10.1))
      System.Buffers (>= 4.5.1) - restriction: || (&& (== netcoreapp3.1) (>= monoandroid)) (&& (== netcoreapp3.1) (>= monotouch)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.0)) (&& (== netcoreapp3.1) (< netstandard1.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (>= xamarinios)) (&& (== netcoreapp3.1) (>= xamarinmac)) (&& (== netcoreapp3.1) (>= xamarintvos)) (&& (== netcoreapp3.1) (>= xamarinwatchos)) (== netstandard2.0) (== netstandard2.1)
      System.Numerics.Vectors (>= 4.4) - restriction: || (&& (== netcoreapp3.1) (< netcoreapp2.0)) (== netstandard2.0) (== netstandard2.1)
      System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== netcoreapp3.1) (>= monoandroid)) (&& (== netcoreapp3.1) (>= monotouch)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.0)) (&& (== netcoreapp3.1) (< netcoreapp2.1)) (&& (== netcoreapp3.1) (< netstandard1.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (>= uap10.1)) (&& (== netcoreapp3.1) (>= xamarinios)) (&& (== netcoreapp3.1) (>= xamarinmac)) (&& (== netcoreapp3.1) (>= xamarintvos)) (&& (== netcoreapp3.1) (>= xamarinwatchos)) (== netstandard2.0) (== netstandard2.1)
    System.Numerics.Vectors (4.5) - restriction: || (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (>= uap10.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) (&& (== netstandard2.1) (>= uap10.1))
    System.Runtime.CompilerServices.Unsafe (4.7.1) - restriction: || (&& (== netcoreapp3.1) (>= monoandroid)) (&& (== netcoreapp3.1) (>= monotouch)) (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.0) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netcoreapp2.1) (< netstandard2.1)) (&& (== netcoreapp3.1) (< netstandard1.1)) (&& (== netcoreapp3.1) (< netstandard2.0)) (&& (== netcoreapp3.1) (>= uap10.1)) (&& (== netcoreapp3.1) (>= xamarinios)) (&& (== netcoreapp3.1) (>= xamarinmac)) (&& (== netcoreapp3.1) (>= xamarintvos)) (&& (== netcoreapp3.1) (>= xamarinwatchos)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) (&& (== netstandard2.1) (>= uap10.1))
    System.Text.Encodings.Web (4.7.1)
      System.Memory (>= 4.5.4) - restriction: || (&& (== netcoreapp3.1) (>= net461)) (&& (== netcoreapp3.1) (< netcoreapp2.1) (< netstandard2.1)) (&& (== netcoreapp3.1) (>= uap10.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) (&& (== netstandard2.1) (>= uap10.1))
    TencentCloudSDK (3.0.69)
      Newtonsoft.Json (>= 11.0.1)
      Pathoschild.Http.FluentClient (>= 3.2)
      System.Text.Encodings.Web (>= 4.4)

业务代码如下

 async{
            let region = getRegion(city)
            let cred = Credential(SecretId="*",SecretKey="*")
            let cvmclient =  CvmClient(cred, region)
            let respFilter =  Filter(Name="private-ip-address",Values=Array.ofList ips); // 创建Filter对象, 以内网ip的维度来查询cvm实例
            let req = DescribeInstancesRequest(Filters=[|respFilter|]);
            let! resp = cvmclient.DescribeInstances(req) |> Async.AwaitTask
            Console.WriteLine(AbstractModel.ToJsonString(resp))
        }

报错如下

System.AggregateException: One or more errors occurred. (Method not found: 'Void Pathoschild.Http.Client.FluentClient..ctor(System.String, System.Net.Http.HttpClient)'.)
 ---> System.MissingMethodException: Method not found: 'Void Pathoschild.Http.Client.FluentClient..ctor(System.String, System.Net.Http.HttpClient)'.
   at TencentCloud.Common.Http.HttpConnection..ctor(String baseUrl, Int32 timeout, String proxy)
   at TencentCloud.Common.AbstractClient.BuildConnection()
   at TencentCloud.Common.AbstractClient.RequestV1(AbstractModel request, String actionName)
   at TencentCloud.Common.AbstractClient.InternalRequest(AbstractModel request, String actionName)
   at TencentCloud.Cvm.V20170312.CvmClient.DescribeInstances(DescribeInstancesRequest req)
   --- End of inner exception stack trace ---
   at lambda_method(Closure , Object )
   at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

接口异常时建议

当接口返回错误时希望能够直接返回详细的错误结果信息实体,也就是code和message,而不是抛出异常!

TencentCloudSDKException

如果api请求失败,sdk默认是抛出TencentCloudSDKException异常,抛出异常本来就是比较耗性能的一个操作,不应该使用Exception来实现业务逻辑,建议在JsonResponseModel类里返回错误码及错误消息

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.