Only way would be to have a try block inside your module php code and then dispatch the action you would like to execute. There is no way to catch eZ Publish exceptions at root, so the template involved would have to be executed from your own module. Note: exceptions/redirections in templates is not recommend when inside view cache for instance.