From 15459267fcda53b29241b23b6fe98b1134986b53 Mon Sep 17 00:00:00 2001 From: pechatnov Date: Tue, 1 Apr 2025 14:51:45 +0300 Subject: YT: Add type name of std::exception to error text in TError constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Без этого, исключение о выходе за пределы массива в векторе выглядит так: ``` vector origin (pid 178121, thread library-cpp-yt-) datetime 2025-03-31T14:59:49.069209Z ``` С фиксом: ``` vector origin (pid 178121, thread library-cpp-yt-) datetime 2025-03-31T14:59:49.069209Z exception_type std::out_of_range ``` commit_hash:7382eba16208f6847d581b901a7df4dfa39452b0 --- library/cpp/yt/error/error.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'library/cpp/yt/error/error.cpp') diff --git a/library/cpp/yt/error/error.cpp b/library/cpp/yt/error/error.cpp index f097697cd6a..ea71a07feed 100644 --- a/library/cpp/yt/error/error.cpp +++ b/library/cpp/yt/error/error.cpp @@ -275,6 +275,7 @@ TError::TErrorOr(const std::exception& ex) *this = errorEx->Error(); } else { *this = TError(NYT::EErrorCode::Generic, TRuntimeFormat{ex.what()}); + *this <<= TErrorAttribute("exception_type", TypeName(ex)); } YT_VERIFY(!IsOK()); Enrich(); -- cgit v1.3