本文整理汇总了C++中std::exception类的典型用法代码示例。如果您正苦于以下问题:C++ exception类的具体用法?C++ exception怎么用?C++ exception使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了exception类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnError
void RFXComTCP::OnError(const std::exception e)
{
_log.Log(LOG_ERROR, "RFXCOM: Error: %s", e.what());
}
示例2: exit
void
AppExceptionHandler::handleExit( const std::exception &e )
{
d_->log( "handleExit", e.what());
exit(1);
}
示例3: operator
void operator()(const std::exception& e) const
{
std::cerr << "std::exception: " << e.what() << '\n';
}
示例4: ThrowJavaException
void ThrowJavaException(JNIEnv* env, const std::exception& e)
{
ThrowJavaException(env, std::string("Exception from libadblockplus: ") + e.what());
}
示例5:
void
AppExceptionHandler::handleThreadExit( const std::exception &e )
{
d_->log( "handleThreadExit", e.what());
Thread::exit();
}
示例6: Exeception
void Display::Exeception(std::exception ex)
{
Verbose::show(" Exception caught:", always);
Verbose::show(std::string("\n ") + ex.what() + "\n\n");
}
示例7: LogException
void CPVRClient::LogException(const std::exception &e, const char *strFunctionName) const
{
CLog::Log(LOGERROR, "PVR - exception '%s' caught while trying to call '%s' on add-on '%s'. Please contact the developer of this add-on: %s", e.what(), strFunctionName, GetFriendlyName().c_str(), Author().c_str());
}
示例8: handleException
void handleException( const std::exception& e )
{
std::cout << e.what() << std::endl;
}
示例9: EventStdException
EventStdException(event_logger::eventLevel l, const std::exception& e, std::wstring from) :
EventDetail(l, boost::posix_time::second_clock::universal_time(), event_logger::generalException),
exception_(hal::from_utf8(e.what())),
from_(from)
{}
示例10: exceptionMessage
void DiagnosticsDialog::exceptionMessage(const std::exception& e, const QString& context)
{
pushMessage(MS_EXCEPTION, (context.isEmpty() ? "" : context + "\n\n" + QString::fromUtf8(e.what())));
// error message is important, make sure the diagnostics are shown
show();
}
示例11: on_std_exception
void qlTimeSeriesDataReaderListenerImpl::on_std_exception( DDS::DataReader_ptr reader, timeseries::qlTimeSeries&, std::exception& e )
{
ACE_ERROR((LM_WARNING,
ACE_TEXT("(%P|%t) WARNING: ")
ACE_TEXT("qlTimeSeriesDataReaderListenerImpl::on_std_exception %s\n"), e.what() ));
}
示例12: XGBHandleException
/*!
* \brief handle exception throwed out
* \param e the exception
* \return the return value of API after exception is handled
*/
int XGBHandleException(const std::exception &e) {
XGBSetGetLastError_(e.what());
return -1;
}
示例13: on_std_exception
void qlMTBrownianGeneratorFactoryDataReaderListenerImpl::on_std_exception( DDS::DataReader_ptr reader, browniangenerators::qlMTBrownianGeneratorFactory&, std::exception& e )
{
ACE_ERROR((LM_WARNING,
ACE_TEXT("(%P|%t) WARNING: ")
ACE_TEXT("qlMTBrownianGeneratorFactoryDataReaderListenerImpl::on_std_exception %s\n"), e.what() ));
}
示例14: operator
void fail_policy::operator()(const std::exception &fail_arg) const
{
std::cerr << "# unexpected exception is unexpected. std::exception::what() says, \""
<< fail_arg.what() << ".\"\n";
}
示例15: ShowError
void
ShowError(const std::exception &exception, const TCHAR *caption)
{
ShowMessageBox(UTF8ToWideConverter(exception.what()), caption,
MB_OK|MB_ICONEXCLAMATION);
}