summaryrefslogtreecommitdiffstats
path: root/yql/essentials/utils/exceptions.cpp
diff options
context:
space:
mode:
authorvvvv <[email protected]>2024-11-01 15:41:40 +0300
committervvvv <[email protected]>2024-11-01 15:55:52 +0300
commit3325f745e67f7f442790822b5c9c5e9996708be7 (patch)
treef7318d68bbe8990092715436444b05297ce35777 /yql/essentials/utils/exceptions.cpp
parent6dce3f1c71786f2694b73b1a5155efc58f4557dd (diff)
Moved yql/utils YQL-19206
Также была выделена жирная зависимость из yql/utils в yql/utils/network, в результате library/cpp/getopt была добавлена явно в те проекты, которые ее ранее наследовали, а не указывали явно commit_hash:36aa4c41f807b4cbbf70a3ed7ac0a1a5079bb75d
Diffstat (limited to 'yql/essentials/utils/exceptions.cpp')
-rw-r--r--yql/essentials/utils/exceptions.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/yql/essentials/utils/exceptions.cpp b/yql/essentials/utils/exceptions.cpp
new file mode 100644
index 00000000000..8a6d09fc9d1
--- /dev/null
+++ b/yql/essentials/utils/exceptions.cpp
@@ -0,0 +1,37 @@
+#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 NFq \ No newline at end of file