[Cook] Aborting a cook invocation

Peter Miller peterm at platypus.net
Thu Jun 12 08:35:00 EST 2003


When a statement fails, it unwinds the execution stack until something
catches the failure, a bit like exceptions in C++.  When a recipe body
fails, the error is reported against the recipe.  When a free-standing
statement fails, it is reported against the *outermost* statement which
fails - in this case the end of the IF statement, as represented by the
closing curly brace. 

> -----Original Message-----
> From: Jerry Pendergraft [mailto:jerry at endocardial.com]
> Sent: Thursday, June 12, 2003 4:57 AM
> To: Jody Hagins
> Cc: cook-users at auug.org.au
> Subject: Re: [Cook] Aborting a cook invocation
> 
> 
> Well it is supposed to ;^)  Peter?
> 
> -- 
> Jerry Pendergraft                        
> jerry.pendergraft at endocardial.com
> Endocardial Solutions                    voice: 651-523-6935
> 1350 Energy Lane, Suite 110                fax: 651-644-7897
> St Paul, MN 55108-5254                  mobile: 651-491-0163
> 
> On Wed, 11 Jun 2003, Jody Hagins wrote:
> 
> > On Wed, 11 Jun 2003 13:03:08 -0500 (CDT)
> > Jerry Pendergraft <jerry at endocardial.com> wrote:
> > 
> > > try
> > > 
> > > if [not [defined variable_y]] then
> > > {
> > >    fail "variable_y is not defined!";
> > > }
> > 
> > 
> > Thanks again, Jerry!
> > 
> > However, this does not exit cook.  Instead, it prints the 
> error message,
> > then continues processing...
> > 
> > 
> > shandalle:jody> cat -n a.a
> >      1
> >      2  if [not [defined variable_1]] then
> >      3  {
> >      4    fail "variable_1 not defined!!!";
> >      5  }
> >      6
> >      7  variable_2 = Foo;
> >      8
> > shandalle:jody> cook -book a.a
> > /* a.list, /home/jody/junk/cookplay, Wed Jun 11 14:47 2003 */
> > cook: variable_1 not defined!!!
> > cook: a.a: 7: statement failed
> > cook: a.a: found 1 fatal error
> > 
> > 
> > 
> > 
> > 
> > 
> 
> _______________________________________________
> Cook-users mailing list
> Cook-users at auug.org.au
> http://www.auug.org.au/mailman/listinfo/cook-users
> 



More information about the Cook-users mailing list