本文整理汇总了C++中std::exception::what方法的典型用法代码示例。如果您正苦于以下问题:C++ exception::what方法的具体用法?C++ exception::what怎么用?C++ exception::what使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::exception
的用法示例。
在下文中一共展示了exception::what方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: myexception
void myexception(std::exception& e) {
std::cout<<"Exception: "<<e.what()<<std::endl;
std::cout.flush();
std::cerr.flush();
exit(1);
}
示例2: throw_exception
void boost::throw_exception(std::exception const & e)
{
std::cout << "Boost exception: " << e.what() << std::endl;
}
示例3:
void Window::DefaultExceptionHandler::HandleException(const std::exception& t)
{
// Try to keep running.
std::cerr << t.what();
}
示例4: operationFailed
void SubscriberReconnectCallback::operationFailed(const std::exception& exception) {
LOG4CXX_ERROR(logger, "Error writing to new subscriber. Channel should pick this up disconnect the channel and try to connect again " << exception.what());
}
示例5: complain
void console::complain(const char * what, std::exception const & e) {
complain(what, e.what());
}
示例6: LogException
void LogException(const std::string& prefix, const std::exception& e, const Args&... args)
{
LogError(prefix, e.what(), args...);
}
示例7: acceptError
void acceptError(const std::exception& ex) noexcept override {
LOG(ERROR) << "Connection accept error: " << ex.what();
}
示例8: on_std_exception
void qlFlatHazardRateDataReaderListenerImpl::on_std_exception( DDS::DataReader_ptr reader, defaulttermstructures::qlFlatHazardRate&, std::exception& e )
{
ACE_ERROR((LM_WARNING,
ACE_TEXT("(%P|%t) WARNING: ")
ACE_TEXT("qlFlatHazardRateDataReaderListenerImpl::on_std_exception %s\n"), e.what() ));
}
示例9:
Exception::Exception(const std::string& msg, const std::exception& e) :
m_msg(msg + " failed with " + std::string(e.what()))
{}
示例10: HandleException
void HandleException(ISafeRunnable::Pointer code,
const std::exception& e)
{
HandleException(code, ctkException(e.what()));
}
示例11: reportError
void Options::reportError(const std::exception& e) const
{
error_stream << "Error: " << e.what()
<< "\nSee '" << program_name_
<< " --help' for available options\n";
}
示例12: throw_exception
void throw_exception(const std::exception & e) {
arx_assert_msg(false, "Boost triggered an unhandled exception! %s", e.what());
ARX_UNUSED(e);
}
示例13: throw_zend_exception_from_std_exception
// Sets EG(exception), call this and then RETURN_NULL();
void throw_zend_exception_from_std_exception(const std::exception& ex) {
zend_throw_exception(zend_exception_get_default(TSRMLS_CC), const_cast<char*>(ex.what()), 0 TSRMLS_CC);
}
示例14: OnError
void RFXComTCP::OnError(const std::exception e)
{
_log.Log(LOG_ERROR, "RFXCOM: Error: %s", e.what());
}
示例15: ensure_contains
void ensure_contains(const std::exception & error, const char * sought) {
ensure_contains(error.what(), sought);
}