public function setExceptionMessage($message = '', $defaultRedirect = null, $key = null) {
		$statusCode = null;
		$redirectUrl = null;
		if ($message instanceof Exception) {
			if ($this->_controller->request->is('ajax')) {
				$statusCode = $message->getCode();
			}
		}
		if (empty($statusCode)) {
			$this->_controller->Flash->error($message);
			$redirectUrl = $this->getRedirectUrl($defaultRedirect, $key);
		}

		return $this->_controller->redirect($redirectUrl, $statusCode);
	}
public function setExceptionMessage($message = '', $defaultRedirect = null, $key = null) {
		$statusCode = null;
		$redirectUrl = null;
		if ($message instanceof Exception) {
			if ($this->_controller->request->is('ajax')) {
				$statusCode = $message->getCode();
			}
		}
		if (empty($statusCode)) {
			$this->_controller->Flash->error($message);
			$redirectUrl = $this->getRedirectUrl($defaultRedirect, $key);
		}

		return $this->_controller->redirect($redirectUrl, $statusCode);
	}
public function setExceptionMessage ( $ message = '' , $ defaultRedirect = null , $ key = null ) { $ statusCode = null ; $ redirectUrl = null ; if ( $ message instanceof Exception ) { if ( $ this -> _controller -> request -> is ( 'ajax' ) ) { $ statusCode = $ message -> getCode ( ) ; } } if ( empty ( $ statusCode ) ) { $ this -> _controller -> Flash -> error ( $ message ) ; $ redirectUrl = $ this -> getRedirectUrl ( $ defaultRedirect , $ key ) ; } return $ this -> _controller -> redirect ( $ redirectUrl , $ statusCode ) ; }
Set Flash message of exception

@param string $message Message to be flashed. If an instance
of Exception the exception message will be used and code will be set
in params.
@param string|array $defaultRedirect Default redirect URL.
Use if redirect URL is not found in cache.
@param string $key Key for cache
@return CakeResponse|null
@see FlashComponent::set()
@see ViewExtensionComponent::getRedirectUrl()
Set Flash message of exception