Skip to content

Exception serialization does not handler Empty exception message. #1066

Closed

Description

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.

Activity

  1. github-actions commented on Sep 19, 2021

    @github-actions

    This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  2. kristofferjalen commented on Oct 19, 2022

    @kristofferjalen

    This bug is still there.

  3. NeilMountford commented on Mar 13, 2024

    @NeilMountford
    Contributor

    This is still an issue, I've created a PR with a unit test: #2857 that will hopefully solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions