1/** 2 * @file op_exception.cpp 3 * exception base class 4 * 5 * @remark Copyright 2003 OProfile authors 6 * @remark Read the file COPYING 7 * 8 * @author Philippe Elie 9 * @author John Levon 10 */ 11 12#include <cstring> 13 14#include "op_exception.h" 15 16using namespace std; 17 18op_exception::op_exception(string const & msg) 19 : 20 message(msg) 21{ 22} 23 24op_exception::~op_exception() throw() 25{ 26} 27 28char const * op_exception::what() const throw() 29{ 30 return message.c_str(); 31} 32 33 34op_fatal_error::op_fatal_error(string const & msg) 35 : 36 op_exception(msg) 37{ 38} 39 40 41op_runtime_error::op_runtime_error(string const & msg) 42 : 43 runtime_error(msg) 44{ 45} 46 47op_runtime_error::op_runtime_error(string const & msg, int cerrno) 48 : 49 runtime_error(msg + "\ncause: " + strerror(cerrno)) 50{ 51} 52 53op_runtime_error::~op_runtime_error() throw() 54{ 55} 56