Skip to content

Exception serialization does not handler Empty exception message. #1066

Description

@cijothomas

Oringally reported:microsoft/ApplicationInsights-aspnetcore#823
Application Insights Rejecting Exceptions with empty Message

Repro:
TelemetryClient tc = new TelemetryClient();
tc.Context.InstrumentationKey = "validikey";
tc.TrackException(new Exception(""));
tc.Flush();

Response from backend:
Field 'message' on type 'ExceptionDetails' is required but missing or empty. Expected: string, Actual: undefined

// The following gets mesage automatically populated, but passing "" or string.empty breaks it.
var ex = new Exception();
tc.TrackException(ex);

Fix would be to modify Exception sanitization to handle this properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions