original_string: protected function checkAndThrow(array $contents)
      {
          if (isset($contents['errcode']) && 0 !== $contents['errcode']) {
              if (empty($contents['errmsg'])) {
                  $contents['errmsg'] = 'Unknown';
              }
              throw new HttpException($contents['errmsg'], $contents['errcode']);
          }
      }
code: protected function checkAndThrow(array $contents)
      {
          if (isset($contents['errcode']) && 0 !== $contents['errcode']) {
              if (empty($contents['errmsg'])) {
                  $contents['errmsg'] = 'Unknown';
              }
              throw new HttpException($contents['errmsg'], $contents['errcode']);
          }
      }
code_tokens: protected function checkAndThrow ( array $ contents ) { if ( isset ( $ contents [ 'errcode' ] ) && 0 !== $ contents [ 'errcode' ] ) { if ( empty ( $ contents [ 'errmsg' ] ) ) { $ contents [ 'errmsg' ] = 'Unknown' ; } throw new HttpException ( $ contents [ 'errmsg' ] , $ contents [ 'errcode' ] ) ; } }
docstring: Check the array data errors, and Throw exception when the contents contains error.
  @param array $contents
  @throws HttpException
docstring_tokens: Check the array data errors and Throw exception when the contents contains error .