original_string: 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;
      }
    }
code: 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;
      }
    }
code_tokens: 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 ; } }
docstring: 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
docstring_tokens: Checks the error in the response .