diff options
| author | pechatnov <[email protected]> | 2025-08-06 18:42:10 +0300 |
|---|---|---|
| committer | pechatnov <[email protected]> | 2025-08-06 19:03:46 +0300 |
| commit | 7bed48dd832fd169b9f9e4b820146228c934734b (patch) | |
| tree | f51a6b2ec3d5a7be749b637c75c2346a56c04bf2 /library/cpp/yt/assert/assert.cpp | |
| parent | a7b92fa6aa8979ff6da2ae0b16c1e3d79c04b95e (diff) | |
Optional description argument for YT_VERIFY, YT_ASSERT and others
commit_hash:80b47f95a2ee356b086f5955f2529f1b0e636db1
Diffstat (limited to 'library/cpp/yt/assert/assert.cpp')
| -rw-r--r-- | library/cpp/yt/assert/assert.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/library/cpp/yt/assert/assert.cpp b/library/cpp/yt/assert/assert.cpp index 095357cdfa8..2329a5118db 100644 --- a/library/cpp/yt/assert/assert.cpp +++ b/library/cpp/yt/assert/assert.cpp @@ -10,6 +10,7 @@ namespace NYT::NDetail { Y_WEAK void AssertTrapImpl( TStringBuf trapType, TStringBuf expr, + TStringBuf description, TStringBuf file, int line, TStringBuf function) @@ -20,8 +21,10 @@ Y_WEAK void AssertTrapImpl( line, function.data(), expr.data(), - "%s", - trapType.data()); + "%s: %.*s", + trapType.data(), + static_cast<int>(std::min<ui64>(description.length(), std::numeric_limits<int>::max())), + description.data()); } //////////////////////////////////////////////////////////////////////////////// |
