[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] Re: StartUp:run should protect itself?

No problem here.

By "more helpful output," do you mean using error.reportError instead of postln?

On Nov 20, 2007, at 8:56 AM, Dan Stowell wrote:

If there are no objections I'll commit this. It's similar to the code
I posted (but with slightly more helpful output), very
straightforward. Have been using it here.


2007/11/16, Dan Stowell <danstowell@xxxxxxxxx>:
Hi -

I'm just getting some of my SC stuff up and running on a new machine,
and I notice that if one of the functions added to StartUp bombs out
with some error (e.g. a ugen I forgot to install, stopping synthdef
compilation), that prevents other startup functions from running.
There's no protection against errors:

        *run {
                done = true;
                "StartUp done.".postln;

Wouldn't it be better to insulate each separate function from the
others by wrapping it in a try{}?

        *run {
                done = true;
                functions.do({ |func|
                                "StartUp: an error has occurred.".postln;
                                "Thrown during function:".postln;
                "StartUp done.".postln;

The functions added to StartUp should all be independent, since
they're typically coming from different classes/scripts. If you want
one startup thing to depend on another, you can (and should) code that
dependence in a single function to be added to StartUp.

This sound sensible?


: H. James Harkins

: jamshark70@xxxxxxxxxxxxxxxxx

: http://www.dewdrop-world.net


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman