libs/wampcc/wamp_session.cc
/** Exception handler for all inbound traffic, i.e., processing raw bytes of a
  * socket and processing inbound messages on the event thread. */
Exception handler for all inbound traffic, i.e., processing raw bytes of a
socket and processing inbound messages on the event thread.
Exception handler for all inbound traffic i . e . processing raw bytes of a socket and processing inbound messages on the event thread .
void wamp_session::handle_exception()
{
  try
  {
    throw;
  }
  catch ( handshake_error& e )
  {
    LOG_WARN(m_log_prefix << "handhake error: " << e.what());
    m_socket->reset();
    drop_connection(e.what());
  }
  catch ( auth_error& e )
  {
    LOG_WARN(m_log_prefix << "auth error: " << e.what());
    drop_connection(e.error_uri());
  }
  catch ( protocol_error& e )
  {
    LOG_WARN(m_log_prefix << "protocol error: " << e.what());
    drop_connection(WAMP_ERROR_BAD_PROTOCOL);
  }
  catch (wamp_error & e)
  {
    LOG_WARN(m_log_prefix << "unexpected wamp error: " << e.what());
    drop_connection(e.error_uri());
  }
  catch (std::exception & e)
  {
    LOG_WARN(m_log_prefix << "exception: " << e.what());
    drop_connection(WAMP_RUNTIME_ERROR);
  }
  catch (...)
  {
    LOG_WARN(m_log_prefix << "unknown exception");
    drop_connection(WAMP_RUNTIME_ERROR);
  }
}
void wamp_session :: handle_exception ( ) { try { throw ; } catch ( handshake_error & e ) { LOG_WARN ( m_log_prefix << " " << e . what ( ) ) ; m_socket -> reset ( ) ; drop_connection ( e . what ( ) ) ; } catch ( auth_error & e ) { LOG_WARN ( m_log_prefix << " " << e . what ( ) ) ; drop_connection ( e . error_uri ( ) ) ; } catch ( protocol_error & e ) { LOG_WARN ( m_log_prefix << " " << e . what ( ) ) ; drop_connection ( WAMP_ERROR_BAD_PROTOCOL ) ; } catch ( wamp_error & e ) { LOG_WARN ( m_log_prefix << " " << e . what ( ) ) ; drop_connection ( e . error_uri ( ) ) ; } catch ( std :: exception & e ) { LOG_WARN ( m_log_prefix << " " << e . what ( ) ) ; drop_connection ( WAMP_RUNTIME_ERROR ) ; } catch ( ... ) { LOG_WARN ( m_log_prefix << " " ) ; drop_connection ( WAMP_RUNTIME_ERROR ) ; } }
Exception handler for all inbound traffic, i.e., processing raw bytes of a
 socket and processing inbound messages on the event thread.
Exception handler for all inbound traffic i . e . processing raw bytes of a socket and processing inbound messages on the event thread .
// We don't expect a wamp_error here; they are intended to be caught inside // the relevant process method.