1cd139dc7SShuo Chen// excerpts from http://code.google.com/p/muduo/ 2cd139dc7SShuo Chen// 3cd139dc7SShuo Chen// Use of this source code is governed by a BSD-style license 4cd139dc7SShuo Chen// that can be found in the License file. 5cd139dc7SShuo Chen// 6cd139dc7SShuo Chen// Author: Shuo Chen (giantchen at gmail dot com) 7cd139dc7SShuo Chen 8cd139dc7SShuo Chen#ifndef MUDUO_BASE_EXCEPTION_H 9cd139dc7SShuo Chen#define MUDUO_BASE_EXCEPTION_H 10cd139dc7SShuo Chen 11cd139dc7SShuo Chen#include <exception> 12cd139dc7SShuo Chen#include <string> 13cd139dc7SShuo Chen 14cd139dc7SShuo Chennamespace muduo 15cd139dc7SShuo Chen{ 16cd139dc7SShuo Chen 17cd139dc7SShuo Chenclass Exception : public std::exception 18cd139dc7SShuo Chen{ 19cd139dc7SShuo Chen public: 206067994fSShuo Chen explicit Exception(const char* what); 21cd139dc7SShuo Chen virtual ~Exception() throw(); 22cd139dc7SShuo Chen virtual const char* what() const throw(); 23cd139dc7SShuo Chen const char* stackTrace() const throw(); 24cd139dc7SShuo Chen 25cd139dc7SShuo Chen private: 26cd139dc7SShuo Chen std::string message_; 27cd139dc7SShuo Chen std::string stack_; 28cd139dc7SShuo Chen}; 29cd139dc7SShuo Chen 30cd139dc7SShuo Chen} 31cd139dc7SShuo Chen 32cd139dc7SShuo Chen#endif // MUDUO_BASE_EXCEPTION_H 33