Esempio n. 1
0
 /**
  *
  * @param int $code
  * @param array $errors
  *
  * @return void
  */
 public function displayError($code, $error)
 {
     $this->setStatus($code);
     $errors = new stdClass();
     $errors->code = $code;
     $errors->message = $error;
     if ($error instanceof Exception) {
         if (ini_get("display_errors")) {
             $errors->message = $error->getMessage();
             $errors->code = $error->getCode();
             $errors->file = $error->getFile();
             $errors->getLine = $error->getLine();
         } else {
             $errors->message = "An unexpected internal error has occurred. Please reference this code when reporting this error: " . Atrox_Core_Exception::makeHash($error);
             Atrox_Base_Application_Exception::log($error);
         }
     }
     $response = new stdClass();
     $response->success = false;
     $response->error = array($errors);
     $this->output(json_encode($response));
 }
Esempio n. 2
0
 public function __construct($message, $code = 0)
 {
     parent::__construct($message, $code);
 }