Re: Tasty exceptions



Michael C. wrote:

First of all, if you are concerned with "Flow of Control",
you don't really need to put exception handlers all over the place.
Why? Because you aren't throwing exceptions in the first place.

Nonsense. Exceptions are designed for flow control and they do it
quite well, if used correctly. The general case (speaking very broadly;
there are, well, exceptions) is that when you get an exception whatever
you are doing should stop.

So the majority of the time you don't write exception handlers
outside of Application.OnException?

Yes. I use try/finally often, try/except with re-raising the exception
infrequently, and try/except without re-raising the exception extremely
rarely.

--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Everything You Need to Know About InterBase Character Sets:
http://blogs.teamb.com/craigstuntz/articles/403.aspx
.



Relevant Pages

  • Re: Exception Handling issue
    ... The system (GWES) calls your DialogProc within it's own try/except block. ... As for the exception you do see on app termination, ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Exception Handling issue
    ... > The system calls your DialogProc within it's own try/except block. ... executed after the exception line, since the system "throws me out of the ... If NOT using MFC i don't get the exeption if i ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Exception Handling issue
    ... Not try/except the call to DialogBox. ... In the DialogProc, put try/except ... > exception occured". ... >> If you weren't using MFC, you wouldn't have to put try/except around all ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: RFC: About error handling - WAS: Re: A remobjects wtf...
    ... Why do you think that both C# and Java allow ... resource as soon as you can), and try to make try/except blocks as big ... most of the times when an exception happens you don't really ... retry, you just let it go up. ...
    (borland.public.delphi.non-technical)
  • Re: variables exist
    ... has a very lightweight exception mechanism. ... Using try/except for non-exceptional behavior can be confusing for readers of your code who assume the normal semantics. ... from __main__ import %s as func mapping = %s keys = %s ... for time, func in sorted([(ifelse_time, ifelse), ]): ...
    (comp.lang.python)