<divclass="content sourceset-depenent-content"data-active=""data-togglable=":docs:dokkaHtml/commonMain"><divclass="symbol monospace"><spanclass="token keyword">open </span><spanclass="token keyword">suspend </span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><spanclass="token keyword"></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>request<spanclass="token operator">: </span><ahref="../../dev.inmo.tgbotapi.requests.abstracts/-request/index.html">Request</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="on-request-exception.html">T</a><spanclass="token operator">></span><spanclass="token punctuation">, </span>t<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html">Throwable</a><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="on-request-exception.html">T</a><spanclass="token operator">?</span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></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>