LoadExtraErrorDetailsFromXml method

  1. @override
Future<bool> LoadExtraErrorDetailsFromXml(
  1. EwsServiceXmlReader reader,
  2. String xmlElementName
)
override
Loads extra error details from XML The reader. The current element name of the extra error details.

Implementation

@override
Future<bool> LoadExtraErrorDetailsFromXml(
    EwsServiceXmlReader reader, String xmlElementName) async {
  bool baseReturnVal =
      await super.LoadExtraErrorDetailsFromXml(reader, xmlElementName);

  if (reader.IsStartElementWithNamespace(
      XmlNamespace.Messages, XmlElementNames.ErrorSubscriptionIds)) {
    do {
      await reader.Read();

      if (reader.NodeType == XmlNodeType.Element &&
          reader.LocalName == XmlElementNames.SubscriptionId) {
        this.ErrorSubscriptionIds.add(
            await reader.ReadElementValueWithNamespace(
                XmlNamespace.Messages, XmlElementNames.SubscriptionId));
      }
    } while (!reader.IsEndElementWithNamespace(
        XmlNamespace.Messages, XmlElementNames.ErrorSubscriptionIds));

    return true;
  } else {
    return baseReturnVal;
  }
}