當前位置: 首頁>>代碼示例>>C#>>正文


C# Exception.ToSdmxException方法代碼示例

本文整理匯總了C#中System.Exception.ToSdmxException方法的典型用法代碼示例。如果您正苦於以下問題:C# Exception.ToSdmxException方法的具體用法?C# Exception.ToSdmxException怎麽用?C# Exception.ToSdmxException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Exception的用法示例。


在下文中一共展示了Exception.ToSdmxException方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Build

        /// <summary>
        /// Builds an object of type  <see cref="SoapException"/>
        /// </summary>
        /// <param name="buildFrom">
        /// An Object to build the output object from
        /// </param>
        /// <param name="uri">
        /// The URI.
        /// </param>
        /// <returns>
        /// Object of type <see cref="SoapException"/>
        /// </returns>
        /// <exception cref="T:Org.Sdmxsource.Sdmx.Api.Exception.SdmxException">
        /// - If anything goes wrong during the build process
        /// </exception>
        public SoapException Build(Exception buildFrom, string uri)
        {
            var sdmxException = buildFrom.ToSdmxException();
            if (sdmxException != null)
            {
                return this.Build(sdmxException, uri);
            }

            _log.ErrorFormat(CultureInfo.InvariantCulture, Resources.ErrorUnhandledFormat2, buildFrom.GetType(), buildFrom.Message);
            _log.Error(buildFrom.ToString());
            return SoapFaultFactory.CreateSoapException(uri, string.Empty, Resources.ErrorInternalError, SdmxV20Errors.ErrorNumberServer, uri, false, buildFrom.Message);
        }
開發者ID:alcardac,項目名稱:SDMXRI_WS_OF,代碼行數:27,代碼來源:SoapFaultExceptionBuilder.cs

示例2: BuildException

        /// <summary>
        /// Builds an object of type  <see cref="FaultException{String}"/>
        /// </summary>
        /// <param name="buildFrom">
        /// An Object to build the output object from
        /// </param>
        /// <param name="uri">
        /// The URI.
        /// </param>
        /// <returns>
        /// Object of type <see cref="FaultException{String}"/>
        /// </returns>
        public FaultException<SdmxFault> BuildException(Exception buildFrom, string uri)
        {
            var faultException = buildFrom as FaultException<SdmxFault>;
            if (faultException != null)
            {
                return faultException;
            }

            var webException = buildFrom as FaultException;
            if (webException != null)
            {
                SdmxFault fault;
                if (webException.Code.IsReceiverFault)
                {
                    fault = new SdmxFault(_sdmxErrorCodeIntenalError.ErrorString, _sdmxErrorCodeIntenalError.ClientErrorCode, uri);
                    return CreateExceptionServer(fault);
                }

                fault = new SdmxFault(buildFrom.Message, _sdmxErrorCodeIntenalError.ClientErrorCode, uri);
                return CreateExceptionClient(fault);
            }

            var sdmxException = buildFrom.ToSdmxException();
            if (sdmxException != null)
            {
                return this.BuildException(sdmxException, uri);
            }

            return CreateExceptionServer(new SdmxFault(_sdmxErrorCodeIntenalError.ErrorString, _sdmxErrorCodeIntenalError.ClientErrorCode, uri));
        }
開發者ID:SDMXISTATFRAMEWORK,項目名稱:ISTAT_ENHANCED_SDMXRI_WS,代碼行數:42,代碼來源:MessageFaultSoapv21Builder.cs

示例3: BuildException

        /// <summary>
        /// Builds an object of type  <see cref="FaultException{String}"/>
        /// </summary>
        /// <param name="buildFrom">
        /// An Object to build the output object from
        /// </param>
        /// <param name="uri">
        /// The URI.
        /// </param>
        /// <returns>
        /// Object of type <see cref="FaultException{String}"/>
        /// </returns>
        public FaultException<SdmxFault> BuildException(Exception buildFrom, string uri)
        {
            var faultException = buildFrom as FaultException<SdmxFault>;
            if (faultException != null)
            {
                return faultException;
            }

            var webException = buildFrom as FaultException;
            if (webException != null)
            {
                SdmxFault fault;
                if (webException.Code.IsReceiverFault)
                {
                    fault = new SdmxFault(Resources.ErrorInternalError, _errorNumberServer, uri);
                    return this.CreateExceptionServer(fault);
                }

                fault = new SdmxFault(buildFrom.Message, _errorNumberClient, uri);
                return this.CreateExceptionClient(fault);
            }

            var sdmxException = buildFrom.ToSdmxException();
            if (sdmxException != null)
            {
                return this.BuildException(sdmxException, uri);
            }

            return this.CreateExceptionServer(new SdmxFault(Resources.ErrorInternalError, _errorNumberServer, uri));
        }
開發者ID:SDMXISTATFRAMEWORK,項目名稱:ISTAT_ENHANCED_SDMXRI_WS,代碼行數:42,代碼來源:MessageFaultSoapv20Builder.cs


注:本文中的System.Exception.ToSdmxException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。