delphi线程异常处理
Here's an interesting fact: No code is error free — in fact, some code is full of "errors" on purpose.
这是一个有趣的事实:没有代码没有错误-实际上,某些代码故意充满了“错误”。
What's an error in an application? An error is an incorrectly coded solution to a problem. Such are logic errors that could lead to wrong function results where everything seems nicely put together but the result of the application is completely unusable. With logic errors, an application might or might not stop working.
应用程序中有什么错误? 错误是对问题的错误编码解决方案。 这些是逻辑错误 ,可能导致错误的功能结果,所有内容看似很好地组合在一起,但应用程序的结果完全无法使用。 遇到逻辑错误, 应用程序可能会或可能不会停止运行。
Exceptions can include errors in your code where you try to divide numbers with zero, or you try using freed memory blocks or try providing wrong parameters to a function. However, an exception in an application is not always an error.
异常可能包括代码中的错误,您尝试将数字除以零,或者尝试使用释放的内存块或向函数提供错误的参数。 但是,应用程序中的异常并不总是错误。
异常和异常类 ( Exceptions and the Exception Class )
Exceptions are special conditions that require special handling. When an error-type condition occurs the program raises an exception.
例外是需要特殊处理的特殊条件。 当发生错误类型的情况时,程序将引发异常。
You (as the application writer) will handle exceptions to make your application more error-prone and to respond to the exceptional condition.