Re: Error Handling

new topic     » goto parent     » topic index » view thread      » older message » newer message

I would rather use simple error return codes, like for open. I think, for
example, that this:

integer fn
fn = open("thefile","w")
if fn = -1 then
    -- do something
end if
-- a bunch of statements here

Looks a lot better than:

integer fn
fn = open("thefile","w")
-- A bunch of statements here
on error do
    -- do something

Jeff Fielding

----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Sent: Saturday, March 17, 2001 8:06 AM
Subject: Re: Error Handling


> Excellent David. Exception handling under the control of the application
is
> the highest priority enhancement required in Euphoria, then comes
namespace
> resolution, and the 'C' translator is not a priority at all for me.
>
> If I can add to David's excellent suggestion (quoted in full below), the
> application might need to know exactly which exception occurred to trigger
> the "on error do" block. So something like Basic's "err" or C's "errno"
> could be set by Euphoria just prior to invoking the "on error" block.
Also,
> the code in there might need a way to resume execution or to retry the
> statement that caused it. This is sounding a lot like Basic's error
handling
> now. But a "resume" and a "retry" statement could be needed.
>
> Still another idea would be to allow application generated exceptions to
be
> handled in the same manner. Maybe via a "raise <exceptionnumber>"
statement.
>
> ------
> Derek Parnell
> Melbourne, Australia
> "To finish a job quickly, go slower."

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu