perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kee Hinckley <naz...@somewhere.com>
Subject Re: Erasing the output
Date Wed, 16 Oct 2002 13:54:58 GMT
At 8:03 AM +0200 10/16/02, Gerald Richter wrote:
>  > At Fri, 11 Oct 2002 06:55:10 +0200, Gerald Richter wrote:
>>  > Some way of exception handling would be nice, that's true. I put it
>>  > on the todo list
>>
>>  i've always thought that "just" allowing die/eval do what they
>>  normally do would be a nice way of handling both "but i want to exit()
>>  to this particular level" and Execute({errors => \@a}) (since error is
>>  in $@).
>>

I'm not entirely sure what was meant by that.

>
>Basicly yes, but I need to give this errors => \@a stuff some more testing
>and see how it interacts with die

Execute works well with throw, which is I assume is equivalent.  I'm 
currently doing the following in my EmbperlObject templates.

     $this = shift;
     my (@errors, $rval);
     try {
         my $rval = Execute({ inputfile => '*', errors => \@errors, 
options => HTML::Embperl::optReturnError});
         if ($rval || @errors) {
             $this->Error(0);
             Execute("$ENV{DOCUMENT_ROOT}/error.html", $rval, @errors);
         }
     } otherwise {
         $this->Error(0);
         Execute("$ENV{DOCUMENT_ROOT}/error.html", 500, $_[0]->{-text});
     };


If I get an error in the page being executed I simply throw the 
error, and that causes the error handling page to be executed with 
the appropriate parameters.

Note that I've been unable to get
	[! use Error qw:try); !]
	[* try { *]
to work at all.  I just get a blank page.
-- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message