Question
I built a server following Webflux functional programming, and added below code to my Router: route(GET("/test/{Id}"), request -> throw new RuntimeException("123")).
But when I call /test/{Id}, the only error log in console is:
TRACE 153036 --- [ctor-http-nio-7] o.s.w.r.function.server.RouterFunctions : [fc7e809d] Matched org.springframework.web.reactive.function.server.RequestPredicates$$Lambda$827/1369035321@9d8c274
DEBUG 153036 --- [ctor-http-nio-7] org.springframework.web.HttpLogging : [fc7e809d] Resolved [RuntimeException: 123] for HTTP GET /test/job
TRACE 153036 --- [ctor-http-nio-7] org.springframework.web.HttpLogging : [fc7e809d] Encoding [{timestamp=Mon Dec 17 15:34:43 CST 2018, path=/test/123, status=500, error=Internal Server Error, message=123}]
TRACE 153036 --- [ctor-http-nio-7] o.s.w.s.adapter.HttpWebHandlerAdapter : [fc7e809d] Completed 500 INTERNAL_SERVER_ERROR, headers={masked}
TRACE 153036 --- [ctor-http-nio-7] org.springframework.web.HttpLogging : [fc7e809d] Handling completed
No stack trace, but why? It should be handled by spring or netty, not my customized code, right? Setting logging.level.org.springframework.web: trace is not a solution, there're too many logs.
Here is what I found so far, but still confused:
I've checked why spring mvc has stack trace, because there is a log.error in try-catch in tomcat and it's proven by debugging.
Then I thought does Netty has these logic too? Actually it has! But what's confuse me is that I can't pause the code in this try-catch with any breakpoints.
Which means there may exists some Mono.onErrorResume swallowing the exception, so netty can't catch anything. But I don't know how to debug a large Mono to check the root cause. And why swallow it?