当前位置: 首页>>代码示例>>C++>>正文


C++ Exception::throwException方法代码示例

本文整理汇总了C++中Exception::throwException方法的典型用法代码示例。如果您正苦于以下问题:C++ Exception::throwException方法的具体用法?C++ Exception::throwException怎么用?C++ Exception::throwException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Exception的用法示例。


在下文中一共展示了Exception::throwException方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: check_request_surprise

ssize_t check_request_surprise(ThreadInfo *info) {
  RequestInjectionData &p = info->m_reqInjectionData;
  bool do_timedout, do_memExceeded, do_signaled;

  ssize_t flags = p.fetchAndClearFlags();
  do_timedout = (flags & RequestInjectionData::TimedOutFlag) &&
    !p.getDebugger();
  do_memExceeded = (flags & RequestInjectionData::MemExceededFlag);
  do_signaled = (flags & RequestInjectionData::SignaledFlag);

  // Start with any pending exception that might be on the thread.
  Exception* pendingException = info->m_pendingException;
  info->m_pendingException = nullptr;

  if (do_timedout && !pendingException) {
    pendingException = generate_request_timeout_exception();
  }
  if (do_memExceeded && !pendingException) {
    pendingException = generate_memory_exceeded_exception();
  }
  if (do_signaled) f_pcntl_signal_dispatch();

  if (pendingException) {
    pendingException->throwException();
  }
  return flags;
}
开发者ID:aakrit,项目名称:hiphop-php,代码行数:27,代码来源:builtin-functions.cpp

示例2: execute

  Variant execute() {
    ASSERT(!m_exception);
    if (m_cp == NULL) {
      return false;
    }
    if (m_emptyPost) {
      // As per curl docs, an empty post must set POSTFIELDSIZE to be 0 or
      // the reader function will be called
      curl_easy_setopt(m_cp, CURLOPT_POSTFIELDSIZE, 0);
    }
    m_write.buf.reset();
    m_write.content.clear();
    m_header.clear();
    memset(m_error_str, 0, sizeof(m_error_str));

    {
      IOStatusHelper io("curl_easy_perform", m_url.data());
      SYNC_VM_REGS_SCOPED();
      m_error_no = curl_easy_perform(m_cp);
      if (m_exception) {
        if (m_phpException) {
          Object e((ObjectData*)m_exception);
          m_exception = NULL;
          e.get()->decRefCount();
          throw e;
        } else {
          Exception *e = (Exception*)m_exception;
          m_exception = NULL;
          e->throwException();
        }
      }
    }
    set_curl_statuses(m_cp, m_url.data());

    /* CURLE_PARTIAL_FILE is returned by HEAD requests */
    if (m_error_no != CURLE_OK && m_error_no != CURLE_PARTIAL_FILE) {
      m_write.buf.reset();
      m_write.content.clear();
      return false;
    }

    if (m_write.method == PHP_CURL_RETURN) {
      if (!m_write.buf.empty()) {
        m_write.content = m_write.buf.detach();
      }
      if (!m_write.content.empty()) {
        return m_write.content;
      }
    }
    if (m_write.method == PHP_CURL_RETURN) {
      return String("");
    }
    return true;
  }
开发者ID:Gauravjeetsingh,项目名称:hiphop-php,代码行数:54,代码来源:ext_curl.cpp

示例3: check_exception

 void check_exception() {
   if (m_exception) {
     if (m_phpException) {
       Object e((ObjectData*)m_exception);
       m_exception = NULL;
       e.get()->decRefCount();
       throw e;
     } else {
       Exception *e = (Exception*)m_exception;
       m_exception = NULL;
       e->throwException();
     }
   }
 }
开发者ID:BauerBox,项目名称:hiphop-php,代码行数:14,代码来源:ext_curl.cpp


注:本文中的Exception::throwException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。