libsex  3.1.0
simple exception library (C++)
Defines
/home/ptr/dev/dev-libs/libsex/libsex/throw.hxx File Reference

Macros related to throwing exceptions. More...

#include <libsex/utility.hxx>

Go to the source code of this file.

Defines

#define THROW_ARGLESS(class)
 Macro to throw an exception without any argument.
#define THROW(class, args...)
 Macro to throw an exception with arguments.
#define CHAIN(class, args...)
 Macro to throw another exception when an exception has been caught.

Detailed Description

Macros related to throwing exceptions.

Definition in file throw.hxx.


Define Documentation

#define CHAIN (   class,
  args... 
)
Value:
{\
        throw libsex::formatted<class>(e, __FILE__, __LINE__, ##args); \
}

Macro to throw another exception when an exception has been caught.

Chains the previous exception and the newly created one together.

Note:
The previous exception has to be accessible in this scope via the variable name e.
Parameters:
classWhich exception to throw.
args...Arguments for message template.
See also:
THROW

Definition at line 50 of file throw.hxx.

#define THROW (   class,
  args... 
)
Value:
{ \
        throw libsex::formatted<class>(__FILE__, __LINE__, ##args); \
}

Macro to throw an exception with arguments.

Parameters:
classWhich exception to throw.
args...Arguments for message template.
See also:
THROW_ARGLESS()

Definition at line 31 of file throw.hxx.

#define THROW_ARGLESS (   class)
Value:
{ \
        throw libsex::formatted<class>(__FILE__, __LINE__); \
}

Macro to throw an exception without any argument.

File name and line number are inserted automatically.

Parameters:
classWhich exception to throw.

Definition at line 19 of file throw.hxx.

 All Classes Files Functions Variables Defines