smallrye / smallrye-health

Home Page:https://smallrye.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include exception FQCN in `rootCause` instead of just the message

famod opened this issue · comments

Due to a config issue in my Quarkus app, I just had this weird looking rootCause value in the readiness check response:

        {
            "name": "my.project.MyWebServiceConnector_ClientProxy",
            "status": "DOWN",
            "data": {
                "rootCause": "class my.project.LoggingFeatureProducer"
            }
        },

It would be nice to include the name of the Exception (here: java.lang.ClassCastException).
Also, an exception can return a null message. In that case you'd at least have the exception name instead of just null.

I suggest using toString() instead of getMessage().
(I must admit though that I haven't checked the spec.)

Code involved: https://github.com/smallrye/smallrye-health/blob/3.3.1/implementation/src/main/java/io/smallrye/health/AsyncHealthCheckFactory.java#L57