【问题标题】:UPS GetRate() Shipping Server Error LogUPS GetRate() 运输服务器错误日志
【发布时间】:2012-08-25 05:50:41
【问题描述】:

有人可以帮助将此错误分解为简单的英语吗?我在我们的服务器应用程序日志中看到以下错误,但不确定错误发生在哪里。它所指的库是 .NET Shipping 库http://dotnetshipping.codeplex.com/releases/view/5241

事件类型:错误 事件源:.NET 运行时 描述: 应用程序:w3wp.exe 框架版本:v4.0.30319 说明:进程因未处理的异常而终止。 异常信息: System.Net.WebException 堆: 在 System.Net.HttpWebRequest.GetResponse() 在 dotNETShipping.ShippingProviders.UPSProvider.GetRates() 在 System.Threading.ExecutionContext.runTryCode(System.Object) 在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode、CleanupCode、System.Object) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object) 在 System.Threading.ThreadHelper.ThreadStart() 有关详细信息,请参阅 http://go.microsoft.com/fwlink/events.asp 上的帮助和支持中心。

【问题讨论】:

    标签: c# .net runtime-error shipping ups


    【解决方案1】:

    The process was terminated due to an unhandled exception. 表示您触发了一个未被 try/catch 语句捕获的错误。从事件来看,它是在您的 HttpWebRequest 对象上发生的。

    尝试将您的语句包装在 try/catch 中,特别是捕获 WebExeception。

    try
    {
        ...
    } 
    catch (WebException wex)
    {
        //add logging statements here. 
    }
    catch(Exception ex)
    {
       //add more logging here 
    }
    

    我建议一开始就倾倒所有关于 Web 异常的信息,然后根据返回的信息纠正问题并将日志记录降低到适当的级别以进行部署。

    【讨论】:

      【解决方案2】:

      您正在开发 .Net Shipping 库吗?上面的异常堆栈跟踪显示异常发生在 dotNETShipping.ShippingProviders.UPSProvider.GetRates() 方法中。如果您只是将库用作第三方库,则需要向库的维护人员报告错误。

      【讨论】:

        猜你喜欢
        • 2022-08-13
        • 2012-04-12
        • 2015-05-08
        • 1970-01-01
        • 2021-02-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多