Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Fix RequestId is empty in exception message
  • Loading branch information
doublnt committed Jul 5, 2019
commit 6d7f2f1e8b065c4ce063ff8ca3fd4fd60a450bd9
9 changes: 7 additions & 2 deletions aliyun-net-sdk-core/Exceptions/ClientException.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Expand All @@ -23,8 +23,13 @@ namespace Aliyun.Acs.Core.Exceptions
{
public class ClientException : Exception
{
public ClientException(string errCode, string errMsg, string requestId) : this(errCode, errMsg)
public ClientException(string errCode, string errMsg, string requestId) : base(
string.Format("{0} : {1} + [ RequestId : {2} ]", errCode, errMsg, requestId))
{
ErrorType = ErrorType.Client;
ErrorMessage = errMsg;
RequestId = requestId;
ErrorCode = errCode;
}

public ClientException(string errCode, string errMsg) : base(errCode + " : " + errMsg)
Expand Down
4 changes: 2 additions & 2 deletions aliyun-net-sdk-core/Exceptions/ServerException.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Expand All @@ -22,7 +22,7 @@ namespace Aliyun.Acs.Core.Exceptions
public class ServerException : ClientException
{
public ServerException(string errorCode, string errorMessage, string requestId) :
this(errorCode, errorMessage)
base(errorCode, errorMessage, requestId)
{
RequestId = requestId;
}
Expand Down