的异常中操作我知道这可能是一个有点古怪,但怀疑毕竟是一个疑问...... 在以下情况下会发生什么......异常在C#
private void SendMail()
{
try
{
//i try to send a mail and it throws an exception
}
catch(Exception ex)
{
//so i will handle that exception over here
//and since an exception occurred while sending a mail
//i will log an event with the eventlog
//All i want to know is what if an exception occurs here
//while writing the error log, how should i handle it??
}
}
谢谢。
+1。顺便说一句:“哟狗,我听说你喜欢捕捉异常,所以我把一个尝试抓住你的试验抓住,所以你赶上,而你赶上。” :) – ANeves 2010-05-18 09:39:03
哈哈辉煌!!!!!!!就我而言,本周评论! – 2010-05-18 09:55:06
嘿大卫, 即使我相信你是正确的,我们应该让第二个异常被抛出,因为最终如果在那里抛出一个异常,那么这将意味着客户端机器存在的问题.... 和我们的第一个偏好是与我们的应用程序相关的例外... 但是我怎么知道我的应用程序中发生了什么错误,因为既没有发送邮件也没有记录错误? 任何建议好友 – Shrewdroid 2010-05-18 10:00:58