惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
S
Securelist
MyScale Blog
MyScale Blog
Jina AI
Jina AI
罗磊的独立博客
The Cloudflare Blog
美团技术团队
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
雷峰网
雷峰网
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
博客园 - 聂微东
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
T
Tailwind CSS Blog
Attack and Defense Labs
Attack and Defense Labs
博客园_首页
Latest news
Latest news
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Hacker News
The Hacker News
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
D
Docker
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
B
Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Security Latest
Security Latest
V2EX - 技术
V2EX - 技术
N
News | PayPal Newsroom
Microsoft Security Blog
Microsoft Security Blog

博客园 - cosophy

C++单例模式 ActiveX控件cab打包、Web嵌入、自动升级攻略 enable all verbs to application hosting on IIS 7.5 and using Asp.net 4.0 ArcGIS 10 FlickrOnMap - A Silverlight Application Developed by Flickr Web API and ArcGIS Server API for Silverlight 关于Arcgis Server REST服务无法使用: Cannot acces http://localhost/arcgis/rest/services - cosophy Installing ArcGIS 9.3 On Microsoft Windows 7 SQL Server 2005 Express混合模式登录设置 List of REST Resources Enable SSL On IIS 7.0 Using Self-Signed Certificates 缅怀遥感地学之父、三院院士陈述彭先生 RSS Disabled: IE 7.0 could not read the RSS Feeds in the Feed List 关于地图投影与坐标系统 WCF:Configure svc MIME type on Vista IIS 7.0 ArcGIS Desktop 9.3 安装、破解 NSDTF-DEM格式数据 [ERR0134] Requested Service is not available 的解决方法 ERDAS 9.1 破解文件下载 修改ASP.NET成员提供程序,配置简单密码规则创建用户
如何正确使用异常
cosophy · 2011-02-28 · via 博客园 - cosophy

1、避免过多使用Finally块,有时候可以考虑using等语句,能达到相同效果;

2、应捕获可以预见的异常,避免捕获所有异常(如Exception,SystemException);

3、当异常无法修复时,回滚部分完成的操作;

4、隐藏实现细节,例如:

  catch(FileNotFoundException e) { throw new NameNotFoundException(name, e); }

  这里就不会显示FileNotFoundException了。