exceptions.h 551 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "query.h"
  3. #include <util/generic/yexception.h>
  4. namespace NClickHouse {
  5. class TServerException: public yexception {
  6. public:
  7. TServerException(std::unique_ptr<TException> e)
  8. : Exception_(std::move(e))
  9. {
  10. }
  11. const TException& GetException() const {
  12. return *Exception_;
  13. }
  14. const char* what() const noexcept override {
  15. return Exception_->DisplayText.c_str();
  16. }
  17. private:
  18. std::unique_ptr<TException> Exception_;
  19. };
  20. }