You are here

class GoogleMiniException in Google Search Appliance 6.2

Same name and namespace in other branches
  1. 5 GoogleMini.php \GoogleMiniException

Hierarchy

Expanded class hierarchy of GoogleMiniException

File

./GoogleMini.php, line 451

View source
class GoogleMiniException extends Exception {
  function __construct($message, $code = null) {
    parent::__construct($message, $code);
    $this->userMessage = GoogleMiniException::getUserMessage($code);
    if (!$this->userMessage) {
      $this->userMessage = $message;
    }
  }
  function getErrorCodes() {
    static $error_codes;
    if (!$error_codes) {
      $error_codes = array(
        '-100' => 'We apologize, but the connection to our search engine appears to be down at the moment, please try again later.',
        '-99' => 'We apologize, but your search cannot be completed at this time, please try again later.',
        '1' => 'No results were found that matched your criteria.  Please try broadening your search.',
        '2' => 'Sorry, but our search does not return more than 1,000 records, please refine your criteria.',
      );
    }
    return $error_codes;
  }
  function getUserMessage($code) {
    $error_codes = $this
      ->getErrorCodes();
    return $error_codes[$code];
  }

}

Members