protected function httpError($errorCode, $message, $exception = null) {
    header("HTTP/1.1 $errorCode $message", true, $errorCode);
    if ($exception) {
      echo json_encode([
        'textStatus' => "$errorCode $message",
        'exception' => get_class($exception),
        'code' => $exception->getCode(),
        'message' => $exception->getMessage()
      ]);
    } else {
      echo json_encode(['textStatus' => "$errorCode $message"]);
    }
    return false;
  }
protected function httpError($errorCode, $message, $exception = null) {
    header("HTTP/1.1 $errorCode $message", true, $errorCode);
    if ($exception) {
      echo json_encode([
        'textStatus' => "$errorCode $message",
        'exception' => get_class($exception),
        'code' => $exception->getCode(),
        'message' => $exception->getMessage()
      ]);
    } else {
      echo json_encode(['textStatus' => "$errorCode $message"]);
    }
    return false;
  }
protected function httpError ( $ errorCode , $ message , $ exception = null ) { header ( "HTTP/1.1 $errorCode $message" , true , $ errorCode ) ; if ( $ exception ) { echo json_encode ( [ 'textStatus' => "$errorCode $message" , 'exception' => get_class ( $ exception ) , 'code' => $ exception -> getCode ( ) , 'message' => $ exception -> getMessage ( ) ] ) ; } else { echo json_encode ( [ 'textStatus' => "$errorCode $message" ] ) ; } return false ; }
Return the request with an HTTP error response.

@param int $errorCode The HTTP status code.
@param string $message The message to place on the HTTP status header line.
@param Exception $exception An optional exception object to report.
@return boolean Always returns false.
@access protected
Return the request with an HTTP error response .