[interchange-cvs] CVS notice: activity by bill

interchange-cvs@lists.akopia.com interchange-cvs@lists.akopia.com
Tue May 29 09:51:00 2001


CVS activity by user 'bill':
interchange/lib/Vend Interpolate.pm,1.40.2.62,1.40.2.63
Update of /anon_cvs/repository/interchange/lib/Vend
In directory developer.akopia.com:/tmp/cvs-serv25879/lib/Vend

Modified Files:
      Tag: DEV_4_7_0
	Interpolate.pm 
Log Message:
Fixed [try] and [catch] tags

1. Modified original behavior of 
[catch]
   [error message]
      catch block
   [/error message]
[/catch]

The original code requires an exact match, including the newline and line
numbers from the Interchange core (i.e., it includes the
  " at (eval line nnn)...\n"
message).

The new code strips the 'at (eval ...' to leave an approximation of the
original $@.

Added 'exact' option to invoke original behavior.

There were no instances of [catch] tag usage in the demos affected by this.

2. Added 'clean' option to [try] tag, which suppresses output in case of
error.  The default tag output behavior is unchanged.

3. Fixed [try] tag to watch $Session->{try}{$label} instead of $@ after the eval
because $@ as originally written does not trap most errors (which occurred in
earlier eval in the Interchange core).


4. I did not change the default interpolation setting, but I recommend changing
the [catch] tag to interpolate by default. The existing implementation of the
[error message][/error message] regex also strips interchange container tags.

For example, there is a bug in the foundation implementation of log_transaction:

   /ic/foundation/etc/log_transaction:141: 
=================================================
   [catch]
   [set mv_route_failed]1[/set]
   There was an error adding to the transaction log.
   [/catch]
=================================================

The [set ...] ... [/set] will silently disappear without setting mv_route_failed.