rlog::Error Class Reference

Error Used as exception thrown from rAssert() on failure. More...

#include <rlog/Error.h>

List of all members.

Public Member Functions

 Error (const char *component, const char *file, const char *function, int line, const char *msg)
 Error (const char *component, const char *file, const char *function, int line, const std::string &msg)
 Error (const Error &src)
Erroroperator= (const Error &src)
void log (RLogChannel *channel) const
const char * component () const
const char * file () const
const char * function () const
int line () const
const char * message () const


Detailed Description

Error Used as exception thrown from rAssert() on failure.

Error is derived from std::runtime_error exception and is thrown from rAssert() to indicate the reason and location of the failure.

  void testFunc()
  {
      bool testAssert = true;
      rAssert( testAssert == false ); // fails..
  }

  void A()
  {
      try
      {
          testFunc();
      } catch( Error &err )
      {
          rDebug("caught assert failure from %s line %i ( %s )",
              err.file(), err.line(), err.function() );
      }
  }

Author:
Valient Gough
See also:
rAssert()


Member Function Documentation

void Error::log ( RLogChannel channel  )  const

Log the error to the given channel

const char * Error::component (  )  const

return component string. If this was due to an rAssert() then this will be the definition of RLOG_COMPONENT at the point of the rAssert.


The documentation for this class was generated from the following files:
Generated on Mon Nov 20 22:57:44 2006 for rlog by  doxygen 1.5.0