text: // Use of this source code is governed by a BSD-style license
  // that can be found in the License file.
  //
  // Author: Shuo Chen (chenshuo at chenshuo dot com)
  
  #ifndef MUDUO_BASE_EXCEPTION_H
  #define MUDUO_BASE_EXCEPTION_H
  
  #include "muduo/base/Types.h"
  #include <exception>
  //异常类
  namespace muduo
  {
  
  class Exception : public std::exception
  {
   public:
    Exception(string what);
    ~Exception() noexcept override = default;
  
    // default copy-ctor and operator= are okay.
  //返回异常信息
    const char* what() const noexcept override
    {
      return message_.c_str();
    }
  //返回异常出现的函数
    const char* stackTrace() const noexcept
    {
      return stack_.c_str();
    }
  
   private:
    string message_;
    string stack_;
  };
  
  }  // namespace muduo
  
  #endif  // MUDUO_BASE_EXCEPTION_H
  