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

Re: [cgiapp] How do you handle errors?


On Wed, 11 Aug 2004 10:56:16 -0500, Jason A. Crome wrote:

Hi Jason

1) Run mode starts, and perhaps generates an error:

	if ($it worked)
	{
		....
	}
	else
	{
		$self -> param(error => 'Oops');
	}

2) Later:

	my($result);

	if ($self -> param('error') )
	{
		my($error) = $self -> load_tmpl('display-error.tmpl');

		$error -> param(error => $self -> param('error') );

		$result = $error -> output();
	}
	elsif ($caller eq 'alias')
	{
		$result = $self -> build_entity_detail($id);
	}
	etc

3) At the end of this run mode:

	$template -> param(result => $result);

	$template -> output();

}	# End of this run mode.

-- 
Ron Savage, suppressed on 12/08/2004. Room EF 312
Deakin University, 221 Burwood Highway, Burwood, VIC 3125, Australia
Phone: +61-3-9251 7067, Fax: +61-3-9251 7604
http://www.deakin.edu.au/~rsav



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.