Exception Handling - Part One (二)

2014-11-24 09:56:21 · 作者: · 浏览: 1
implication of the exception

In case of exception, you can either exit the app or just write some error log or simply raise an warning alert to user in the GUI.

This really depends on the implication:
If the exception is fatal, e.g. the data might be massed up, then you have to exit the app and shut down it immediately.
If the exception is some merely a user error, then you can raise an alert in the GUI.
If the exception is not critical and it's a backgroud process, then program can simply wirte a exception log entry for that.

In other cases, it is the caller to depends how to handle the error appropriately.