Skip to content

Commit 66033d6

Browse files
committed
wip: catch and log exceptions in netty handler
Signed-off-by: Dario Valdespino <dvaldespino00@gmail.com>
1 parent 2e4efd3 commit 66033d6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/graalvm/src/main/kotlin/elide/runtime/intrinsics/server/http/v2/channels/NettyHttpContextAdapter.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ internal class NettyHttpContextAdapter(
9999
super.write(ctx, msg, promise)
100100
}
101101

102+
override fun exceptionCaught(ctx: ChannelHandlerContext, cause: Throwable?) {
103+
logging.error("Unhandled exception in HTTP context", cause)
104+
closeCurrent(ctx)
105+
}
106+
102107
/** Handle a new incoming [request], closing the current one if active and initializing a new context. */
103108
private fun handleIncoming(channelContext: ChannelHandlerContext, request: HttpRequest) {
104109
closeCurrent(channelContext)

0 commit comments

Comments
 (0)