本文整理汇总了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);
}
示例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));
}
示例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));
}