[Zope-CMF] DcworkFlow swallows second parameter to ObjectMoved

Dieter Maurer dieter@handshake.de
Wed, 4 Sep 2002 20:03:23 +0200


Robert Rottermann writes:
 > I am trying to move an object during a transaction.
 > in the transaction script I raise ObjectMoved(neobj, "url to the new
 > object") exception.
 > However this second  parameter gets swallowed later on when ObjectMoved is
 > rerisen.
 > ...
 >             try:
 >                 script(sci)  # May throw an exception.
 >             except ObjectMoved, ex:
 >                 ob = ex.getNewObject()
 >                 moved = 1
 >                 # Don't re-raise
 > 
 >         # Return the new state object.
 >         if moved:
 >             # Re-raise.
 >             raise ObjectMoved(ob) <--------------- here it gets lost
Funny code.

  One would expect the author wanted to prevent a reraise
  conciously. But, then, it reraises anyway. It just discards
  the result.

  Maybe, you ask Shane why he does this.

In my scripts, I redirect myself and do give the framework a chance.


Dieter