Skip to content

Commit cb5c4d4

Browse files
Improve exception message in telemetry (#256)
* Improve exception message in telemtry * ErrorKind must be serializable to put it in Exception.Data * Update code Co-authored-by: Erich(Renyong) Wang <eriwan@microsoft.com>
1 parent 1e12cdf commit cb5c4d4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Authentication.Abstractions/Interfaces/IContainsAzPSErrorData.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System;
16+
1517
namespace Microsoft.Azure.Commands.Common
1618
{
1719
/// <summary>
@@ -44,6 +46,7 @@ public interface IContainsAzPSErrorData
4446
/// <summary>
4547
/// Represent Error Kind
4648
/// </summary>
49+
[Serializable]
4750
public class ErrorKind
4851
{
4952
public string Value { get; private set; }

src/Common/MetricHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ public override string ToString()
566566
"AzureQoSEvent: CommandName - {0}; IsSuccess - {1}; Duration - {2}", CommandName, IsSuccess, Duration);
567567
if (Exception != null)
568568
{
569-
ret = $"{ret}; Exception - {Exception};";
569+
ret = $"{ret}; Exception - {Exception.Message};";
570570
}
571571
return ret;
572572
}

0 commit comments

Comments
 (0)