aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/clickhouse/client/exceptions.h
blob: d27c5352f96d928810ac65ea6d76eee4078616cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include "query.h"

#include <util/generic/yexception.h>

namespace NClickHouse {
    class TServerException: public yexception {
    public:
        TServerException(std::unique_ptr<TException> e)
            : Exception_(std::move(e))
        {
        }

        const TException& GetException() const {
            return *Exception_;
        }

        const char* what() const noexcept override {
            return Exception_->DisplayText.c_str();
        }

    private:
        std::unique_ptr<TException> Exception_;
    };

}