<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":tgbotapi.core:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">open </span><spanclass="token keyword">suspend </span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><ahref="on-request-exception.html">T</a><spanclass="token operator"> : </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><spanclass="token operator">></span><ahref="on-request-exception.html"><spanclass="token function">onRequestException</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">request<spanclass="token operator">: </span><ahref="../../dev.inmo.tgbotapi.requests.abstracts/-request/index.html">Request</a><spanclass="token operator"><</span><ahref="on-request-exception.html">T</a><spanclass="token operator">></span><spanclass="token punctuation">, </span></span><spanclass="parameter ">t<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html">Throwable</a></span></span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="on-request-exception.html">T</a><spanclass="token operator">?</span></div><pclass="paragraph">Will be called when any exception will happen due to the <ahref="on-request-exception.html">request</a> handling. If returns value - that value will be returned from <ahref="../../dev.inmo.tgbotapi.bot/-requests-executor/execute.html">dev.inmo.tgbotapi.bot.RequestsExecutor.execute</a> instead</p></div></div>