New in KO 3.3 is the HTTP::redirect method, which works by throwing an HTTP_Exception_302, which bubbles up and gets handled by the system to do the actual redirect.
My question is: how can I do a redirect without catching its exception if I'm calling the redirect within a try...catch
block?
e.g.:
try {
if($var === TRUE){
HTTP::redirect(URL::site($_REQUEST['redirect_uri']));
}else{
throw new Exception('Error');
}
} catch(Exception $e) {
$this->template->errors[] = $e->getMessage();
}
This will not cause a redirect, because the generic Exception handler will catch it. How do I avoid this?