随笔 - 9  文章 - 12  trackbacks - 0
<2006年12月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

常用链接

留言簿(2)

随笔档案

相册

搜索

  •  

最新评论

阅读排行榜

评论排行榜

  1. Handle problems at the appropriate level. (Avoid catching exceptions unless you know what to do with them).
  2. Fix the problem and call the method that caused the exception again.
  3. Patch things up and continue without retrying the method.
  4. Calculate some alternative result instead of what the method was supposed to produce.
  5. Do whatever you can in the current context and rethrow the same exception to a higher context.
  6. Do whatever you can in the current context and throw a different exception to a higher context.
  7. Terminate the program.
  8. Simplify. (If your exception scheme makes things more complicated, then it is painful and annoying to use.)
  9. Make your library and program safer. (This is a short-term investment for debugging, and a long-term investment for application robustness.)
posted on 2006-12-07 14:59 人生如戏 阅读(245) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: