1. crash_message

Robert Craig wrote:

> With the new crash_file(filename) routine on
> Linux(coming soon to DOS and Windows) you can
> replace "ex.err" by a file of your own choosing...

I'd like to see a crash_routine variable, so I can set up something like
this:

   crash_routine = routine_id("myRecoveryRoutine")

-- David Cuny

new topic     » topic index » view message » categorize

2. Re: crash_message

David Cuny wrote:

>I'd like to see a crash_routine variable, so I can set up something
>like this:
>
>   crash_routine = routine_id("myRecoveryRoutine")

But what happens if your recovery routine has an error and causes a crash?
smile

Just thought I'd point it out, because I used to get myself in a *TON* of
trouble in Basic, doing this kind of thing with buggy "on error" routines.

 -- Gabriel Boehme

new topic     » goto parent     » topic index » view message » categorize

3. Re: crash_message

Gabriel Boehme wrote:

> Just thought I'd point it out, because I used to get
> myself in a *TON* of trouble in Basic, doing this
> kind of thing with buggy "on error" routines.

The ON ERROR routines in BASIC are intended to be exception handlers that
allow you to re-enter your program again. That's not really what I had in
mind, and certainly not something that I expect Robert would ever be
pursuaded to add.

Instead, I want to be able to trigger a custom data save routine. For
example, if the editor aborts for some reason, the work in progress can be
saved before the application shuts down. The application would not attempt
to recover from the error.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

4. Re: crash_message

----- Original Message -----
From: Boehme, Gabriel <gboehme at POBOXB1.HQ.MSMAIL.MUSICLAND.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Tuesday, August 31, 1999 1:46 PM
Subject: Re: crash_message


> David Cuny wrote:
>
> >I'd like to see a crash_routine variable, so I can set up something
> >like this:
> >
> >   crash_routine = routine_id("myRecoveryRoutine")
>
> But what happens if your recovery routine has an error and causes a crash?
> smile
>
> Just thought I'd point it out, because I used to get myself in a *TON* of
> trouble in Basic, doing this kind of thing with buggy "on error" routines.

If your error routines are single-pass, like starting at one end of a
daisychain and each error ripple-passes to the other end, there is no
problem with loopy errors like that. The last error handler could be the
non-replaceable non-preemptable standard Eu error handler, it would simply
report the most recent error it is handed, even if it occurs in a preceeding
user-written error handler.

Kat

new topic     » goto parent     » topic index » view message » categorize

5. Re: crash_message

David Cuny wrote:

>The ON ERROR routines in BASIC are intended to be exception handlers that
>allow you to re-enter your program again. That's not really what I had in
>mind, and certainly not something that I expect Robert would ever be
>pursuaded to add.
>
>Instead, I want to be able to trigger a custom data save routine. For
>example, if the editor aborts for some reason, the work in progress can be
>saved before the application shuts down. The application would not attempt
>to recover from the error.

I wasn't suggesting that the application would try to recover from the
error. In fact, I rarely made use of ON ERROR in that way. I mostly used it
in the same way you want to use "crash_routine" -- to perform some emergency
shutdown-type actions in the event of a crash.

And I'm still not convinced that a "crash_routine" implementation in
Euphoria would avoid the sorts of problems I experienced with ON ERROR in
BASIC. For example, if we were able to code this...

crash_routine(routine_id("myCrashRoutine"))

..and we later encounter an error that would normally cause the program to
crash, then the interpreter would instead execute "myCrashRoutine". Now,
what happens if "myCrashRoutine" contains errors? Or if it calls the same
routine that caused the original crash? Does the program execute
"myCrashRoutine" again, looping forever, or do you get two ex.err dumps
describing what caused the original crash and what caused the crash routine
to crash?

The "crash_routine" idea seems useful at first, but the more I look at it,
the more it reminds me of all the trouble I was able to get myself into with
ON ERROR in BASIC. As far as I'm concerned, the existing "crash_message()"
ability is more than adequate.

 -- Gabriel Boehme

new topic     » goto parent     » topic index » view message » categorize

6. Re: crash_message

Gabriel Boehm wrote:

> Now, what happens if "myCrashRoutine" contains errors?

Obviously, you want your crash routines to be as bulletproof as possible.
And you only want it called once - more than that, and Euphoria fails the
way that it does now.

> As far as I'm concerned, the existing "crash_message()"
> ability is more than adequate.

Given the choice between:

   1. A possibly recoverable file (named xxx.BAK)

and

   2. An error message and complete loss of data

The first is infinitely preferable.

-- David Cuny

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu