Error checking V.S. Exception
来源:互联网 发布:搜狗浏览器 mac 编辑:程序博客网 时间:2024/05/29 05:58
1)Error checking
if (bad_condition) then
begin
ShowMsg("bad");
return ERROR_CODE_1;
end;
2)raise exception
if (bad_condition) then
raise Exception.Create("bad")
comparision:
1)communicate with UI directly, the program is not flexiable
2)return exception to caller, then choose to handle or show to user, it's more flexiable
if (bad_condition) then
begin
ShowMsg("bad");
return ERROR_CODE_1;
end;
2)raise exception
if (bad_condition) then
raise Exception.Create("bad")
comparision:
1)communicate with UI directly, the program is not flexiable
2)return exception to caller, then choose to handle or show to user, it's more flexiable
- Error checking V.S. Exception
- Syntax Error v.s. Exception, (try, except, finally) - Python
- Mongodb分片时,两台服务器时间不同步caught exception while doing balance: error checking clock skew of cluster
- Lint error checking 的解决办法
- Error & Exception
- error exception
- checking for tgetent()... configure: error: NOT FOUND!
- checking for DirectFB... configure: error:解决
- Linux 启动提示checking filesystems error解决办法
- ERROR in checking system st_geometry type
- Checking API: checkapi-last (unknown): error
- While checking XXX pngcrush caught libpng error:
- Lustre V.S. Hadoop V.S. Gluster
- Program v/s Process v/s Thread
- Mutex v/s Semaphore v/s Spinlock
- 安装docker镜像时Error checking TLS connection: Error checking and/or regenerating the certs
- ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0) java.lang.ClassNotFoundException: main.s
- C# v.s JAVA
- SSL + WS-Security = Web Service安全保障
- E文积累_20071210_Achilles heel
- 同步 线程 事件
- sos.exe 病毒与sos.exe专杀工具
- 重新过一遍ASP.NET 2.0(C#)(7) - Profile(存储用户配置)
- Error checking V.S. Exception
- (原创程序)志远信息管理系统 v1.0
- UML学习手记(四):用例分析之范围工具“内/外”列表
- 学习cweb
- 18位身份证号码最后一位校验码的计算方法
- 写给WEB2.0的站长
- 深入理解数据库原理系列(1)---日志系统原理
- IT 人士群聚喝酒的讲究
- C#委托示例