mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-01-22 05:07:55 +00:00
deploy: f22d571484
This commit is contained in:
@@ -95,7 +95,7 @@
|
||||
<div class="cover ">
|
||||
<h1 class="cover"><span>caused</span><wbr><span>Cancellation</span><wbr><span><span>Exception</span></span></h1>
|
||||
</div>
|
||||
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":tgbotapi.core:dokkaHtmlPartial/commonMain"><div class="symbol monospace"><span class="token keyword">fun </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html">Throwable</a><span class="token punctuation">.</span><a href="caused-cancellation-exception.html"><span class="token function">causedCancellationException</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/CancellationException///PointingToDeclaration/">CancellationException</span><span class="token operator">?</span></div></div></div>
|
||||
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":tgbotapi.core:dokkaHtmlPartial/commonMain"><div class="symbol monospace"><span class="token keyword">fun </span><a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html">Throwable</a><span class="token punctuation">.</span><a href="caused-cancellation-exception.html"><span class="token function">causedCancellationException</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><span data-unresolved-link="kotlinx.coroutines/CancellationException///PointingToDeclaration/">CancellationException</span><span class="token operator">?</span></div><p class="paragraph">Traverses this throwable's cause chain to find a <span data-unresolved-link="kotlinx.coroutines/CancellationException///PointingToDeclaration/">CancellationException</span>.</p><p class="paragraph">It walks through <code class="lang-kotlin">this</code> and its <code class="lang-kotlin">cause</code>s until the first <span data-unresolved-link="kotlinx.coroutines/CancellationException///PointingToDeclaration/">CancellationException</span> is encountered, and returns that exception. If no <span data-unresolved-link="kotlinx.coroutines/CancellationException///PointingToDeclaration/">CancellationException</span> is found in the chain, returns <code class="lang-kotlin">null</code>.</p><p class="paragraph">This is useful when you need to distinguish cancellations from other failures while handling errors.</p><span class="kdoc-tag"><h4 class="">Receiver</h4><p class="paragraph">the root <a href="https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html">Throwable</a> to inspect</p></span><span class="kdoc-tag"><h4 class="">Return</h4><p class="paragraph">the first <span data-unresolved-link="kotlinx.coroutines/CancellationException///PointingToDeclaration/">CancellationException</span> found in the cause chain, or <code class="lang-kotlin">null</code> if none present</p></span></div></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<a href="#content" id="go-to-top-link" class="footer--button footer--button_go-to-top"></a>
|
||||
|
||||
Reference in New Issue
Block a user