当前位置: 首页>>代码示例>>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;未经允许,请勿转载。