Redian新闻
>
Re: Error handling in Jelly, SwixML and
avatar
Re: Error handling in Jelly, SwixML and# Java - 爪哇娇娃
c*s
1

它抛出的都是JellyException,JellyException继承NestableException。里面放着原始
的错误。
最终这些错误被一路扔出来,Jelly自己不处理(当然了,它怎么会知道该怎么处理?)

简单的使用commons-logging,warning和debugging也是。
该扔异常就扔异常。不是每个类都有能力和责任去handle异常的。
这些异常可以最终由外层的程序专心用最合适的方法去处理。
我比较喜欢让错误不要被隐藏起来。GUI设计里可以有个console window,专门显示系统
级的异常。就像eclipse里的Error Log Window。
avatar
c*t
2
The problem with pure exception approach is the recovery. In GUI design
for example, often there are variable assignments (that is, assign the
generated JTextField to a variable) which can be ignored in preview GUI
step. Yet, in actually running the program, you want to throw an exception.
Thus, it actually requires a configurable mechanism to selectively turning
on/off exception throwing. In certain cases, you just want to generate
a warning. Sometimes, you want to log everything(warning, d

【在 c*****s 的大作中提到】
:
: 它抛出的都是JellyException,JellyException继承NestableException。里面放着原始
: 的错误。
: 最终这些错误被一路扔出来,Jelly自己不处理(当然了,它怎么会知道该怎么处理?)
: 。
: 简单的使用commons-logging,warning和debugging也是。
: 该扔异常就扔异常。不是每个类都有能力和责任去handle异常的。
: 这些异常可以最终由外层的程序专心用最合适的方法去处理。
: 我比较喜欢让错误不要被隐藏起来。GUI设计里可以有个console window,专门显示系统
: 级的异常。就像eclipse里的Error Log Window。

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。