blob: 0a813bf8c3629ac60c09f8cd24be4d232cab09b9 (
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
28
29
30
31
32
33
34
35
36
37
38
39
|
#include "exceptions.h"
#include <util/string/builder.h>
namespace NYql {
TCodeLineException::TCodeLineException(ui32 code)
: SourceLocation("", 0)
, Code(code)
{
}
TCodeLineException::TCodeLineException(const TSourceLocation& sl, const TCodeLineException& t)
: yexception(t)
, SourceLocation(sl)
, Code(t.Code)
{
}
const char* TCodeLineException::GetRawMessage() const {
return yexception::what();
}
const char* TCodeLineException::what() const noexcept {
try {
if (!Message) {
Message = TStringBuilder{} << SourceLocation << TStringBuf(": ") << yexception::what();
}
return Message.c_str();
} catch (...) {
return "Unexpected exception in TCodeLineException::what()";
}
}
TCodeLineException operator+(const TSourceLocation& sl, TCodeLineException&& t) {
return TCodeLineException(sl, t);
}
} // namespace NYql
|