<commit_before>﻿// -----------------------------------------------------------------------------------------
// <copyright file="StorageExtendedErrorInformation.cs" company="Microsoft">
//    Copyright 2013 Microsoft Corporation
// 
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//      http://www.apache.org/licenses/LICENSE-2.0
// 
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.
// </copyright>
// -----------------------------------------------------------------------------------------


namespace Microsoft.WindowsAzure.Storage
{
    using Microsoft.WindowsAzure.Storage.Core;
    using Microsoft.WindowsAzure.Storage.Core.Util;
    using Microsoft.WindowsAzure.Storage.Shared.Protocol;
    using Microsoft.WindowsAzure.Storage.Table.Protocol;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Net;
#if WINDOWS_RT || NETCORE
    using System.Net.Http;
    using System.Threading.Tasks;
#endif
    using System.Xml;

#if WINDOWS_RT
    using Windows.Storage.Streams;
#endif

    /// <summary>
    /// Represents extended error information returned by the Microsoft Azure storage services.
    /// </summary>
#if WINDOWS_DESKTOP && !WINDOWS_PHONE
    [Serializable]
#endif
    public sealed class StorageExtendedErrorInformation
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="StorageExtendedErrorInformation"/> class.
        /// </summary>
        public StorageExtendedErrorInformation()
        {
        }

        /// <summary>
        /// Gets the storage service error code.
        /// </summary>
        /// <value>A string containing the storage service error code.</value>
        [System.Obsolete("Use RequestResult.ErrorCode instead", false)]
        public string ErrorCode { get; internal set; }

        /// <summary>
        /// Gets the storage service error message.
        /// </summary>
        /// <value>A string containing the storage service error message.</value>
        public string ErrorMessage { get; internal set; }

        /// <summary>
        /// Gets additional error details from XML-formatted input stream.
        /// </summary>
        /// <value>An <see cref="IDictionary{TKey,TValue}"/> containing the additional error details.</value>
        public IDictionary<string, string> AdditionalDetails { get; internal set; }

#if WINDOWS_RT
        public static StorageExtendedErrorInformation ReadFromStream(IInputStream inputStream)
        {
            return ReadFromStream(inputStream.AsStreamForRead());
        }

        public static Task<StorageExtendedErrorInformation> ReadFromStreamAsync(IInputStream inputStream)
        {
            return ReadFromStreamAsync(inputStream.AsStreamForRead());
        }
#endif

        /// <summary>
        /// Gets the error details from an XML-formatted error stream.
        /// </summary>
        /// <param name="inputStream">The input stream.</param><commit_msg>[9.1][hotfix] Remove the obsolete tag from ErrorCode property on ExtendedInformation<commit_after>﻿// -----------------------------------------------------------------------------------------
// <copyright file="StorageExtendedErrorInformation.cs" company="Microsoft">
//    Copyright 2013 Microsoft Corporation
// 
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//      http://www.apache.org/licenses/LICENSE-2.0
// 
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.
// </copyright>
// -----------------------------------------------------------------------------------------


namespace Microsoft.WindowsAzure.Storage
{
    using Microsoft.WindowsAzure.Storage.Core;
    using Microsoft.WindowsAzure.Storage.Core.Util;
    using Microsoft.WindowsAzure.Storage.Shared.Protocol;
    using Microsoft.WindowsAzure.Storage.Table.Protocol;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Net;
#if WINDOWS_RT || NETCORE
    using System.Net.Http;
    using System.Threading.Tasks;
#endif
    using System.Xml;

#if WINDOWS_RT
    using Windows.Storage.Streams;
#endif

    /// <summary>
    /// Represents extended error information returned by the Microsoft Azure storage services.
    /// </summary>
#if WINDOWS_DESKTOP && !WINDOWS_PHONE
    [Serializable]
#endif
    public sealed class StorageExtendedErrorInformation
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="StorageExtendedErrorInformation"/> class.
        /// </summary>
        public StorageExtendedErrorInformation()
        {
        }

        /// <summary>
        /// Gets the storage service error code.
        /// </summary>
        /// <value>A string containing the storage service error code.</value>
        public string ErrorCode { get; internal set; }

        /// <summary>
        /// Gets the storage service error message.
        /// </summary>
        /// <value>A string containing the storage service error message.</value>
        public string ErrorMessage { get; internal set; }

        /// <summary>
        /// Gets additional error details from XML-formatted input stream.
        /// </summary>
        /// <value>An <see cref="IDictionary{TKey,TValue}"/> containing the additional error details.</value>
        public IDictionary<string, string> AdditionalDetails { get; internal set; }

#if WINDOWS_RT
        public static StorageExtendedErrorInformation ReadFromStream(IInputStream inputStream)
        {
            return ReadFromStream(inputStream.AsStreamForRead());
        }

        public static Task<StorageExtendedErrorInformation> ReadFromStreamAsync(IInputStream inputStream)
        {
            return ReadFromStreamAsync(inputStream.AsStreamForRead());
        }
#endif

        /// <summary>
        /// Gets the error details from an XML-formatted error stream.
        /// </summary>
        /// <param name="inputStream">The input stream.</param>
{'fraction_non_alphanumeric': 0.14855448480355818, 'fraction_numerical': 0.0026686434395848777, 'mean_word_length': 2.1986723565670934, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3861010', 'n_tokens_mistral': 1603, 'n_tokens_neox': 1572, 'n_words': 524}