本文整理汇总了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;
}
示例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;
}
示例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();
}
}
}