text: #ifndef CUSTOMEXCEPTION_HPP
  #define CUSTOMEXCEPTION_HPP
  
  #include <exception>
  #include <string>
  #include <sstream>
  #include <iostream>
  
  namespace SDK
  {
  //>>>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  //宏函数 自定义抛出的异常信息
  
  /*
  *  @brief 自定义抛出的异常信息
  *  @param exMsg:异常信息
  *  @return 格式化的异常信息
  */
  #define THROW_EXCEPTION(exMsg)\
  {\
       std::ostringstream message;\
       message<<"File: "<<__FILE__<<"\n"\
                    <<"Line:"<<__LINE__<<"\n"\
                    <<"Func:"<<__FUNCTION__<<"\n"\
                    << " " << "\n"\
                    <<"Detail:"<< exMsg <<"\n";\
       std::string msg = message.str();\
       throw SDK::CustomException(msg);\
  }
  
  //<<<----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  
  /**
   *  @brief CustomException
   *         自定义异常类,格式化输出错误信息，并且错误信息可追加
   *
   *  @author grace
   *  @version 1.00 2017-11-27 grace
   *                note:create it
   */
  class CustomException: public std::exception
  {
  public:
  
      //>>>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      //constructor & destructor
  
      /*
      *  @brief 默认构造函数
      *  @param NA
      *  @return NA
      */
      CustomException();
  
      /*
      *  @brief 带参构造函数，初始化成员变量，初始化成传入的参数
      *  @param message：把成员变量m_originalMsg(显示的异常信息)初始化成message
      *  @return NA
      */
      CustomException(std::string& message);
  
      /*
      *  @brief 析构函数
      *  @param NA
      *  @return NA
      */
      virtual ~CustomException();
      //<<<----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  
      //>>>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      //get & set function
  
      const std::string originalMsg ()const;
  
      virtual const char* what() const _GLIBCXX_USE_NOEXCEPT override
      {
          return m_originalMsg.data();
      }
  
      //<<<----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  
  
  private:
      //>>>----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      //member variant
  
      std::string m_originalMsg = '\0'; //显示的异常信息
  
      //<<<----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  
  };//End of class CustomException
  }//End of namespace SDK
  
  #endif // CUSTOMEXCEPTION_HPP
  