0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
Hypertable::Exception Class Reference

This is a generic exception class for Hypertable. More...

#include <Error.h>

Inheritance diagram for Hypertable::Exception:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::Exception:
Collaboration graph
[legend]

Public Types

typedef std::runtime_error Parent
 

Public Member Functions

 Exception (int error, int l=0, const char *fn=0, const char *fl=0)
 Constructor. More...
 
 Exception (int error, const String &msg, int l=0, const char *fn=0, const char *fl=0)
 Constructor. More...
 
 Exception (int error, const String &msg, const Exception &ex, int l=0, const char *fn=0, const char *fl=0)
 Constructor. More...
 
 Exception (const Exception &ex)
 Copy constructor. More...
 
 ~Exception () throw ()
 Destructor. More...
 
int code () const
 Returns the error code. More...
 
int line () const
 Returns the source code line number where the exception was thrown. More...
 
const char * func () const
 Returns the name of the function which threw the Exception. More...
 
const char * file () const
 Returns the source code line number where the exception was thrown. More...
 
virtual std::ostream & render_message (std::ostream &out) const
 Renders an Exception to an ostream. More...
 
virtual std::ostream & render_messages (std::ostream &out, const char *sep) const
 Renders multiple Exceptions to an ostream. More...
 
ExceptionMessageRenderer message () const
 Retrieves a Renderer for this Exception. More...
 
ExceptionMessagesRenderer messages (const char *sep=": ") const
 Retrieves a Renderer for chained Exceptions. More...
 

Public Attributes

Exceptionprev
 The previous exception in the exception chain. More...
 

Private Member Functions

const Exceptionoperator= (const Exception &)
 Do not allow assignments. More...
 

Private Attributes

int m_error
 The error code. More...
 
int m_line
 The source code line where the exception was thrown. More...
 
const char * m_func
 The function name where the exception was thrown. More...
 
const char * m_file
 The source code file where the exception was thrown. More...
 

Detailed Description

This is a generic exception class for Hypertable.

It takes an error code as a constructor argument and translates it into an error message. Exceptions can be "chained".

Definition at line 314 of file Error.h.

Member Typedef Documentation

typedef std::runtime_error Hypertable::Exception::Parent

Definition at line 331 of file Error.h.

Constructor & Destructor Documentation

Hypertable::Exception::Exception ( int  error,
int  l = 0,
const char *  fn = 0,
const char *  fl = 0 
)
inline

Constructor.

Parameters
errorThe error code
lThe source code line
fnThe function name
flThe file name

Definition at line 340 of file Error.h.

Hypertable::Exception::Exception ( int  error,
const String msg,
int  l = 0,
const char *  fn = 0,
const char *  fl = 0 
)
inline

Constructor.

Parameters
errorThe error code
msgAn additional error message
lThe source code line
fnThe function name
flThe file name

Definition at line 352 of file Error.h.

Hypertable::Exception::Exception ( int  error,
const String msg,
const Exception ex,
int  l = 0,
const char *  fn = 0,
const char *  fl = 0 
)
inline

Constructor.

Parameters
errorThe error code
msgAn additional error message
exThe previous exception in the exception chain
lThe source code line
fnThe function name
flThe file name

Definition at line 367 of file Error.h.

Hypertable::Exception::Exception ( const Exception ex)
inline

Copy constructor.

Parameters
exThe exception that is copied

Definition at line 377 of file Error.h.

Hypertable::Exception::~Exception ( )
throw (
)
inline

Destructor.

Definition at line 384 of file Error.h.

Member Function Documentation

int Hypertable::Exception::code ( ) const
inline

Returns the error code.

Returns
The error code of this exception.
See also
Error::get_text to retrieve a descriptive error string

Definition at line 391 of file Error.h.

const char* Hypertable::Exception::file ( ) const
inline

Returns the source code line number where the exception was thrown.

Returns
The file name

Definition at line 409 of file Error.h.

const char* Hypertable::Exception::func ( ) const
inline

Returns the name of the function which threw the Exception.

Returns
The function name

Definition at line 403 of file Error.h.

int Hypertable::Exception::line ( ) const
inline

Returns the source code line number where the exception was thrown.

Returns
The line number

Definition at line 397 of file Error.h.

ExceptionMessageRenderer Hypertable::Exception::message ( ) const
inline

Retrieves a Renderer for this Exception.

Definition at line 429 of file Error.h.

ExceptionMessagesRenderer Hypertable::Exception::messages ( const char *  sep = ": ") const
inline

Retrieves a Renderer for chained Exceptions.

Definition at line 434 of file Error.h.

const Exception& Hypertable::Exception::operator= ( const Exception )
private

Do not allow assignments.

virtual std::ostream& Hypertable::Exception::render_message ( std::ostream &  out) const
inlinevirtual

Renders an Exception to an ostream.

Parameters
outReference to the ostream

Definition at line 415 of file Error.h.

std::ostream & Hypertable::Exception::render_messages ( std::ostream &  out,
const char *  sep 
) const
virtual

Renders multiple Exceptions to an ostream.

Parameters
outReference to the ostream
sepThe separator between the Exceptions, i.e. ':'

Definition at line 396 of file Error.cc.

Member Data Documentation

int Hypertable::Exception::m_error
private

The error code.

Definition at line 319 of file Error.h.

const char* Hypertable::Exception::m_file
private

The source code file where the exception was thrown.

Definition at line 328 of file Error.h.

const char* Hypertable::Exception::m_func
private

The function name where the exception was thrown.

Definition at line 325 of file Error.h.

int Hypertable::Exception::m_line
private

The source code line where the exception was thrown.

Definition at line 322 of file Error.h.

Exception* Hypertable::Exception::prev

The previous exception in the exception chain.

Definition at line 439 of file Error.h.


The documentation for this class was generated from the following files: