this obviously was not my clearest question ever. This is what I want to
accomplish:
sub urlrequest {
my $c= shift;
if (!eval{ $x= callme() }) {
/(.*):(.*)/;
$c->flash( message => $1 ); return $c->redirect_to( $2 );
}
... do more with $x ....
}
sub callme { return calldeeper( ); }
sub calldeeper { ($somethingbadhashappened) and completelyredirect( );
return 1; }
sub completelyredirect { die "you are too young to die:/respawn/restart");
}
but rather than trapping errors, I would prefer to write
sub urlrequest { callme( ); }
sub callme { calldeeper( ); }
sub calldeeper { ($somethingbadhashappened) and completelyredirect( ); }
sub completelyredirect { $c->flash( message => "you are too young to die" );
$c->redirect_to("/respawn/restart"); exit; }
I think the exception object you are mentioning is the M way to do this?
or is there something even simpler? like a "flush the redirect_to to the
browser".
regards,
/iaw
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.