Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populate required string value for property Message #2697

Conversation

kristofferjalen
Copy link

Fix Issue #1066.

Note: This change requires careful review. Also, I have not run the tests, since it's not possible to build the projects locally.

Changes

Application Insights is rejecting exceptions with Exception.Message property being empty or null, as illustrated by an example:

var configuration = TelemetryConfiguration.CreateDefault();
configuration.ConnectionString = "InstrumentationKey=...";
var telemetryClient = new TelemetryClient(configuration);
telemetryClient.TrackException(new Exception("")); // ignored
telemetryClient.TrackException(new Exception("foo")); // logged
telemetryClient.Flush();

Response:

{
    "itemsReceived": 1,
    "itemsAccepted": 0,
    "errors":
    [
        {
            "index": 0,
            "statusCode": 400,
            "message": "109: Field 'message' on type 'ExceptionDetails' is required but missing or empty. Expected: string, Actual: undefined"
        }
    ]
}

Checklist

  • I ran Unit Tests locally.
  • CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

For significant contributions please make sure you have completed the following items:

  • Design discussion issue #
  • Changes in public surface reviewed

The PR will trigger build, unit tests, and functional tests automatically. Please follow these instructions to build and test locally.

Notes for authors:

  • FxCop and other analyzers will fail the build. To see these errors yourself, compile localy using the Release configuration.

Notes for reviewers:

  • We support comment build triggers
    • /AzurePipelines run will queue all builds
    • /AzurePipelines run <pipeline-name> will queue a specific build

@kristofferjalen
Copy link
Author

@microsoft-github-policy-service agree company="Kristoffer Jälén"

@TimothyMothra
Copy link
Member

Hello
Can you please add a unit test for this case? I think in the ExceptionConverterTest.cs file.

What issues are you having building this locally?
We've had a handful of users comment, but we've never been able to reproduce the issue.
You're welcome to review our Workflows to see example of how we build the project.

@github-actions
Copy link

This PR is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants