示例#1
0
void myexception(std::exception& e) {
	std::cout<<"Exception: "<<e.what()<<std::endl;
	std::cout.flush();
	std::cerr.flush();
	exit(1);
}
示例#2
0
void boost::throw_exception(std::exception const & e)
{
	std::cout << "Boost exception: " << e.what() << std::endl;
}
示例#3
0
void Window::DefaultExceptionHandler::HandleException(const std::exception& t)
{
  // Try to keep running.
  std::cerr << t.what();
}
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
0
void console::complain(const char * what, std::exception const & e) {
	complain(what, e.what());
}
示例#6
0
文件: error.hpp 项目: glftpd/ebftpd
void LogException(const std::string& prefix, const std::exception& e, const Args&... args)
{
  LogError(prefix, e.what(), args...);
}
示例#7
0
 void acceptError(const std::exception& ex) noexcept override {
   LOG(ERROR) << "Connection accept error: " << ex.what();
 }
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() ));
}
void qlRelinkableHandleDefaultProbabilityTermStructureDataReaderListenerImpl::on_std_exception( DDS::DataReader_ptr reader, defaulttermstructures::qlRelinkableHandleDefaultProbabilityTermStructure&, std::exception& e )
{
  ACE_ERROR((LM_WARNING,
             ACE_TEXT("(%P|%t) WARNING: ")
             ACE_TEXT("qlRelinkableHandleDefaultProbabilityTermStructureDataReaderListenerImpl::on_std_exception %s\n"), e.what() ));
}
示例#10
0
Exception::Exception(const std::string& msg, const std::exception& e) :
   m_msg(msg + " failed with " + std::string(e.what()))
   {}
示例#11
0
 void HandleException(ISafeRunnable::Pointer code,
                      const std::exception& e)
 {
   HandleException(code, ctkException(e.what()));
 }
示例#12
0
void Options::reportError(const std::exception& e) const
{
    error_stream << "Error: " << e.what()
                 << "\nSee '" << program_name_
                 << " --help' for available options\n";
}
示例#13
0
	void throw_exception(const std::exception & e) {
		arx_assert_msg(false, "Boost triggered an unhandled exception! %s", e.what());
		ARX_UNUSED(e);
	}
示例#14
0
// 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);
}
示例#15
0
void RFXComTCP::OnError(const std::exception e)
{
	_log.Log(LOG_ERROR, "RFXCOM: Error: %s", e.what());
}
示例#16
0
void ensure_contains(const std::exception & error, const char * sought) {
	ensure_contains(error.what(), sought);
}
void qlAssetSwap2DataReaderListenerImpl::on_std_exception( DDS::DataReader_ptr reader, assetswap::qlAssetSwap2&, std::exception& e )
{
  ACE_ERROR((LM_WARNING,
             ACE_TEXT("(%P|%t) WARNING: ")
             ACE_TEXT("qlAssetSwap2DataReaderListenerImpl::on_std_exception %s\n"), e.what() ));
}
示例#18
0
 inline
 std::string
 to_string( std::exception const & x )
     {
     return x.what();
     }
void
boost::throw_exception(std::exception const& ex)
{
    std::cout << ex.what() << std::endl;
    abort();
}
示例#20
0
 } CATCH(const std::exception& e) {
     LogWarning << "Got exception while instantiating geometry (after controller failed) (" << scene.GetInstanceController(c._objectIndex)._reference.AsString().c_str() << "). Exception details:";
     LogWarning << e.what();
 }
void SubscriberConsumeCallback::operationFailed(const std::exception& exception) {
  LOG4CXX_ERROR(logger, "ConsumeCallback::operationFailed  " << data->getTopic() << " - " << data->getSubscriberId());
  
  int retrywait = client->getConfiguration().getInt(Configuration::SUBSCRIBER_CONSUME_RETRY_WAIT_TIME,
						    DEFAULT_SUBSCRIBER_CONSUME_RETRY_WAIT_TIME);

  LOG4CXX_ERROR(logger, "Error passing message to client transaction: " << data->getTxnId() << " error: " << exception.what() 
		<< " retrying in " << retrywait << " Microseconds");

  boost::asio::deadline_timer t(handler->getChannel()->getService(), boost::posix_time::milliseconds(retrywait));

  t.async_wait(boost::bind(&SubscriberConsumeCallback::timerComplete, handler, m, boost::asio::placeholders::error));  
}
示例#22
0
void JniThrowException(JNIEnv* env, const std::exception& e)
{
  JniThrowException(env, e.what());
}
void ConsumeWriteCallback::operationFailed(const std::exception& exception) {
  int retrywait = client->getConfiguration().getInt(Configuration::MESSAGE_CONSUME_RETRY_WAIT_TIME, 
						    DEFAULT_MESSAGE_CONSUME_RETRY_WAIT_TIME);
  LOG4CXX_ERROR(logger, "Error writing consume transaction: " << data->getTxnId() << " error: " << exception.what() 
		<< " retrying in " << retrywait << " Microseconds");

  boost::asio::deadline_timer t(client->getService(), boost::posix_time::milliseconds(retrywait));

  t.async_wait(boost::bind(&ConsumeWriteCallback::timerComplete, client, data, boost::asio::placeholders::error));  
}
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();
}
示例#25
0
void MySensorsTCP::OnError(const std::exception e)
{
	_log.Log(LOG_ERROR,"MySensors: %s",e.what());
}
示例#26
0
    /**
     * Rethrow an exception of type specified by the dynamic type of
     * the specified exception, adding the specified line number to
     * the specified exception's message.
     *
     * @param[in] e original exception
     * @param[in] line line number in Stan source program where
     *   exception originated
     * @param[in] reader trace of how program was included from files
     */
    inline void rethrow_located(const std::exception& e, int line,
                                const io::program_reader& reader =
                                  stan::io::program_reader()) {
      using std::bad_alloc;          // -> exception
      using std::bad_cast;           // -> exception
      using std::bad_exception;      // -> exception
      using std::bad_typeid;         // -> exception
      using std::ios_base;           // ::failure -> exception
      using std::domain_error;       // -> logic_error
      using std::invalid_argument;   // -> logic_error
      using std::length_error;       // -> logic_error
      using std::out_of_range;       // -> logic_error
      using std::logic_error;        // -> exception
      using std::overflow_error;     // -> runtime_error
      using std::range_error;        // -> runtime_error
      using std::underflow_error;    // -> runtime_error
      using std::runtime_error;      // -> exception
      using std::exception;

      // create message with trace of includes and location of error
      std::stringstream o;
      o << "Exception: " << e.what();
      if (line < 1) {
        o << "  Found before start of program.";
      } else {
        io::program_reader::trace_t tr = reader.trace(line);
        o << "  (in '" << tr[tr.size() - 1].first
          << "' at line " << tr[tr.size() - 1].second;
        for (int i = tr.size() - 1; --i >= 0; )
          o << "; included from '" << tr[i].first
            << "' at line " << tr[i].second;
        o << ")" << std::endl;
      }
      std::string s = o.str();

      if (is_type<bad_alloc>(e))
        throw located_exception<bad_alloc>(s, "bad_alloc");
      if (is_type<bad_cast>(e))
        throw located_exception<bad_cast>(s, "bad_cast");
      if (is_type<bad_exception>(e))
        throw located_exception<bad_exception>(s, "bad_exception");
      if (is_type<bad_typeid>(e))
        throw located_exception<bad_typeid>(s, "bad_typeid");
      if (is_type<domain_error>(e))
        throw domain_error(s);
      if (is_type<invalid_argument>(e))
        throw invalid_argument(s);
      if (is_type<length_error>(e))
        throw length_error(s);
      if (is_type<out_of_range>(e))
        throw out_of_range(s);
      if (is_type<logic_error>(e))
        throw logic_error(s);
      if (is_type<overflow_error>(e))
        throw overflow_error(s);
      if (is_type<range_error>(e))
        throw range_error(s);
      if (is_type<underflow_error>(e))
        throw underflow_error(s);
      if (is_type<runtime_error>(e))
        throw runtime_error(s);

      throw located_exception<exception>(s, "unknown original type");
    }
示例#27
0
文件: main.cpp 项目: WhiZTiM/coliru
 void throw_exception(std::exception const& e) {
     std::cerr << "Fake exception: " << e.what() << "\n";
     std::exit(255);
 }
示例#28
0
 CEGUI_CATCH (std::exception& exc)
 {
     outputExceptionMessage(exc.what());
 }
示例#29
0
void StackException::add(const std::exception &e) {
	add("%s", e.what());
}
void UncaughtThreadException::setException(const std::exception& ex)
{
   mDescription = ex.what();
   mLocation = "";
   mStackTrace = "";
}