Exemple #1
0
 /**
  * Exception handling for the web API
  *
  * Handle CHttpException instances more gracefully, and defer to the
  * exception handler of {@link ResponseUtil} in all other cases.
  *
  * @param Exception $e
  */
 public function handleException($e)
 {
     if ($e instanceof CHttpException) {
         $this->send((int) $e->statusCode, $e->statusCode == 404 ? "Invalid URI: " . Yii::app()->request->requestUri : $e->getMessage());
     } else {
         $this->log("Uncaught exception [" . $e->getCode() . "]: " . $e->getMessage());
         ResponseUtil::respondWithException($e);
     }
 }