Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

atoms/error.cc

Go to the documentation of this file.
00001 
00009 #include <atoms/error.hh>
00010 #include <stdarg.h>
00011 
00012 using namespace atoms;
00013 
00014 Error::Error(const Error &o) : what_(o.what_), owner_(o.owner_) {
00015     if (o.owner_) {
00016         what_ = strdup(what_);
00017         if (what_ == NULL)
00018             throw MemoryError();
00019     }
00020 }
00021 
00022 void Error::logCaught(DebugLogger &logger, DebugLogger::Level level,
00023                       const char *extraFmt, ...) const {
00024     va_list(args);
00025     va_start(args,extraFmt);
00026     logger.log(level, "Caught exception: %s", what());
00027 #ifdef ATOMS_DEBUG
00028     logger.log(level, "Exception has backtrace");
00029     b.print();
00030 #endif
00031     if (extraFmt != NULL)
00032         logger.log(level, extraFmt, args);
00033     va_end(args);
00034 }

Generated on Wed Jun 15 01:20:35 2005 for atoms++ by doxygen 1.3.5