aliyun / aliyun-openapi-net-sdk

Alibaba Cloud SDK for .NET
https://www.nuget.org/profiles/aliyun-openapi-sdk
Other
541 stars 625 forks source link

Aliyun.Acs.Alidns.Model Response 缺少调用错误的返回字段 #379

Closed SimTsai closed 4 years ago

SimTsai commented 4 years ago

Alidns SDK中的所有response都没有处理调用错的的返回字段Code, Message, 导致调用后需要解析http response判断调用状态。以及提取错误码和错误信息。

REQUEST

https://alidns.aliyuncs.com/?AccessKeyId=<>&Action=DescribeSubDomainRecords&Format=JSON&RegionId=default&SecureTransport=true&SignatureMethod=HMAC-SHA1&SignatureNonce=983563768994953541f9fac09852ab19&SignatureVersion=1.0&SourceIp=<>&SubDomain=<>&Timestamp=2020-07-30T02%3A05%3A20Z&Version=2015-01-09&Signature=j%2Bh7ZxfJORJ8V%2B50VMixEd3oK44%3D

RESPONSE

{
    "RequestId": "5291AE40-F25B-446C-A348-166B08989800",
    "HostId": "alidns.aliyuncs.com",
    "Code": "IncorrectDomainUser",
    "Message": "The domain name belongs to other users. Transfer the domain name to the current user and then try the binding and setting actions."
}

MODEL DescribeSubDomainRecordsResponse

liaoyustudent commented 4 years ago

您好,SDK在请求返回错误码时应会抛出错误,不需要再对Response进行解析,是否有具体的示例截图