micronaut-core icon indicating copy to clipboard operation
micronaut-core copied to clipboard

ExceptionHandler implementation is not handling errors

Open sparrowlegs opened this issue 1 year ago • 2 comments

Expected Behavior

After I implement an ExceptionHandler class for a RedisConnectionException, my handler (RedisErrorHandler) is invoked when a RedisConnectionException is thrown.

Actual Behaviour

The RedisErrorHandler.handle method (see example application) is not called after a RedisConnectionException is thrown.

Steps To Reproduce

  1. Check out the example application
  2. Verify that Redis is not running on localhost:6379. lsof -i :6379 returns nothing.
  3. Run the tests ./mvnw verify
  4. See the broken MonkeyTest

Environment Information

  • Operating System: macOS Sonoma 14.3
  • Java SDK: 21.0.2
  • Java SDK Vender: Zulu

Example Application

https://github.com/sparrowlegs/micronaut-error-handler-bug

Version

4.2.4

sparrowlegs avatar Jan 26 '24 16:01 sparrowlegs

the test passes for me on linux, without redis running.

yawkat avatar Feb 16 '24 09:02 yawkat

I've added a Docker file to help with testing. Just run:

docker build -t micronaut-error-handler-bug .

The tests fail, even on linux.

sparrowlegs avatar Feb 22 '24 19:02 sparrowlegs