5#ifndef ALSON_COMMUNICATION_BASE_EXCEPTION_COMMON_EXCEPTION_H
6#define ALSON_COMMUNICATION_BASE_EXCEPTION_COMMON_EXCEPTION_H
19#ifndef ALS_EXCEPTION_NOEXCEPT
20# if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
21# define ALS_EXCEPTION_NOEXCEPT
23# define ALS_EXCEPTION_NOEXCEPT noexcept
31class CommonExceptionImpl;
73 CommonException(uint64_t code,
const std::string& message, uint64_t line = 0,
const std::string& filename =
"");
75 CommonException(std::exception& cause, uint64_t code,
const std::string& message, uint64_t line = 0,
const std::string& filename =
"");
94 std::
string getStackTrace() const;
107 uint64_t getCode() const;
120 std::
string getMessage() const;
139 char const* what() const ALS_EXCEPTION_NOEXCEPT override;
CommonException(CommonException &&) noexcept=default
~CommonException() override=default
CommonException(const CommonException &)=default
CommonException(uint64_t code, const std::string &message, uint64_t line=0, const std::string &filename="")
CommonException(CommonException &cause, uint64_t code, const std::string &message, uint64_t line=0, const std::string &filename="")
CommonException(std::exception &cause, uint64_t code, const std::string &message, uint64_t line=0, const std::string &filename="")
CommonException & operator=(const CommonException &)=default
std::shared_ptr< CommonExceptionImpl > CommonExceptionImplPtr