Forum OpenACS Development: Re: CATCH

Collapse
4: Re: CATCH (response to 1)
Posted by Brian Fenton on
Hi Judith!
what does forward page_error mean?

Something to watch out for is how you use curly braces with the "if" command. Always put your newline between 2 curly braces e.g.

set db [ns_db gethandle]
if { [catch { db_dml $db "SQL" } errmsg] } {
forward page_error?
}

ns_db releasehandle $db
....

See Philip Greenspun's TCL book:
http://philip.greenspun.com/tcl/control-structure.adp