Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members

LoggingExceptions.h File Reference

#include "glite/wmsutils/exception/Exception.h"
#include <pthread.h>

Go to the source code of this file.

Classes

class  Exception
class  LoggingException
class  OSException

Defines

#define EXCEPTION_MANDATORY
#define STACK_ADD
#define throw_exception(context, exception)
#define check_result(code, context, desc)   if((code)) throw_exception((context), desc)


Detailed Description

Version:
Revision
1.6

Define Documentation

#define check_result code,
context,
desc   )     if((code)) throw_exception((context), desc)
 

Utility macro to check result of L&B calls.

Checks return value of L&B calls and throws exception if the code failed.

#define EXCEPTION_MANDATORY
 

Value:

__FILE__,                                     \
        __LINE__,                                     \
        std::string(CLASS_PREFIX) + __FUNCTION__
Mandatory exception fields.

This defines the mandatory parameters for all exception constructors (filename, line, method name).

#define STACK_ADD
 

Stacking exceptions.

This was originally used for creating the exception chain; now the same result is achieved by adding the nested exception to the constructor parameter list.

#define throw_exception context,
exception   ) 
 

Value:

{ STACK_ADD;                                          \
  {                                                   \
     char *text, *desc;                               \
     int  code;                                       \
     std::string exc;                                      \
                                                      \
     code = edg_wll_Error((context), &text, &desc);   \
     exc = exception;                                 \
     if (text) {                                      \
        exc += ": ";                                  \
        exc += text;                                  \
     }                                                \
     if (desc) {                                      \
        exc += ": ";                                  \
        exc += desc;                                  \
     }                                                \
     free(text);                                      \
     free(desc);                                      \
     throw LoggingException(EXCEPTION_MANDATORY,      \
                            code,                     \
                            exc);                     \
  }                                                   \
}
Utility macro to throw LoggingException.

This macro is used to obtain the L&B error message and throw the appropriate exception. Note: we can use __LINE__ several times in macro, it is expanded into one row.


Generated on Wed Jun 27 13:43:06 2007 for Glite LB Client: CPP - Interface by doxygen 1.3.5