public function checkGitkitError($response) {
    if (isset($response['error'])) {
      $error = $response['error'];
      if (!isset($error['code'])) {
        throw new Gitkit_ServerException('null error code from Gitkit server');
      } else {
        $code = $error['code'];
        if (strpos($code, '4') === 0) {
          throw new Gitkit_ClientException($error['message']);
        } else {
          throw new Gitkit_ServerException($error['message']);
        }
      }
    } else {
      return $response;
    }
  }
public function checkGitkitError($response) {
    if (isset($response['error'])) {
      $error = $response['error'];
      if (!isset($error['code'])) {
        throw new Gitkit_ServerException('null error code from Gitkit server');
      } else {
        $code = $error['code'];
        if (strpos($code, '4') === 0) {
          throw new Gitkit_ClientException($error['message']);
        } else {
          throw new Gitkit_ServerException($error['message']);
        }
      }
    } else {
      return $response;
    }
  }
public function checkGitkitError ( $ response ) { if ( isset ( $ response [ 'error' ] ) ) { $ error = $ response [ 'error' ] ; if ( ! isset ( $ error [ 'code' ] ) ) { throw new Gitkit_ServerException ( 'null error code from Gitkit server' ) ; } else { $ code = $ error [ 'code' ] ; if ( strpos ( $ code , '4' ) === 0 ) { throw new Gitkit_ClientException ( $ error [ 'message' ] ) ; } else { throw new Gitkit_ServerException ( $ error [ 'message' ] ) ; } } } else { return $ response ; } }
Checks the error in the response.

@param array $response server response to be checked
@return array the response if there is no error
@throws Gitkit_ClientException if input is invalid
@throws Gitkit_ServerException if there is server error
Checks the error in the response .