class="token punctuation">)</span><span class="token operator"> -&gt; </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a><span class="token operator">?</span><span class="clearfix"><span class="floating-right">(<a href="https://github.com/e5l/mcp-kotlin-sdk/org/jetbrains/kotlinx/mcp/shared/WebSocketMcpTransport.kt#L36">source</a>)</span></span></div><p class="paragraph">Callback for when an error occurs.</p><p class="paragraph">Note that errors are not necessarily 