WidgetErrorInfoReportedArgs.ErrorJson Property

Definition

Gets a JSON string describing the error that triggered the error event.

public:
 property Platform::String ^ ErrorJson { Platform::String ^ get(); };
winrt::hstring ErrorJson();
public string ErrorJson { get; }
var string = widgetErrorInfoReportedArgs.errorJson;
Public ReadOnly Property ErrorJson As String

Property Value

String

Platform::String

winrt::hstring

A JSON string.

Remarks

The JSON string returned by this property uses the following format:

{
  "host": "dashboard.microsoft.com",
  "version": "1.0",
  "errorKind": "cardValidation",
  "didRenderCard": true,
  "validationEvents": ["Too many actions defined", "Unknown element type: 'myNewType'"],
  "source": [
    "\"actions\":[{\"type\":\"Action.Submit\",\"title\":\"Action1\"}, {\"type\":\"Action.Submit\",\"title\":\"Action2\"}, {\"type\":\"Action.Submit\",\"title\":\"Action3\"}]",
    "{\"type\":\"myNewType\",\"myProperty\":\"My Value\"}"
  ]
}

Error reporting can occur for card validation errors and card creation errors. The following sections provide detailed information about the format of the JSON telemetry data format for each type of error.

CardValidation error

An event containing the cardValidation error kind is raised when the provided card template populated with the provided card data produces any rendering error or warning from the ones detailed in the AdaptiveCards ValidationEvent enumeration. This event is intended to help developers during the development and testing phases of their Widgets, but there may be cases where this event is raised after a Widget has been released.

Property Value
host String that identifies the host sending the error info.
version Version of the JSON payload schema.
errorKind "cardValidation"
didRenderCard Boolean that represents whether the card was able to be rendered. For example, a 'TooManyActions' validation event will be raised for a Widget that can be rendered with fewer actions than the Widget developer may expect, but a 'DuplicateId' validation event may produce a card that can not be rendered.
validationEvents Array of strings containing validation events. The validation event list is generated by the AdaptiveCards library when parsing and rendering the card.
sourceJson Array of JSON snippets containing the AdaptiveCards content that raised this event. This value is generated by the AdaptiveCards library.

Example JSON payload for a card validation error.

{
    "host": "dashboard.microsoft.com",
    "version": "1.0",
    "errorKind": "cardValidation",
    "didRenderCard": true,
    "validationEvents": ["Too many actions defined", "Unknown element type: 'myNewType'"],
    "source": [
        "\"actions\":[{\"type\":\"Action.Submit\",\"title\":\"Action1\"}, {\"type\":\"Action.Submit\",\"title\":\"Action2\"}, {\"type\":\"Action.Submit\",\"title\":\"Action3\"}]",
        "{\"type\":\"myNewType\",\"myProperty\":\"My Value\"}"
    ]
}

CardCreationFailed error

An event containing the cardCreationFailed error kind is raised when a card template cannot be successfully populated by its corresponding provided card data, for example, if a key referred in the template cannot be found in the data. This event is intended to help developers during the development and testing phases of their Widgets, but there may be cases where this event is raised after a Widget has been released.

Property Value
host String that identifies the host sending the error info.
version Version of the JSON payload schema.
errorKind "cardCreationFailed"
message Error that occurred when the card template was being populated with its corresponding card data. This string is the same as the generated by the AdaptiveCards templating and rendering libraries and is not localized.

Example JSON payload for a card creation failed error.

{
    "host": "dashboard.microsoft.com",
    "version": "1.0",
    "errorKind": "cardCreationFailed",
    "message": "Could not find symbol 'createdUtc' in card data in line 23."
}

Applies to