NoStackTraceThrowable Exception is thrown when Postgres DB connectivity is lost

565 Views Asked by At

Quarkus App - Rest Operation to fetch data from Postgres DB

Quarkus version : 2.9.0.Final

Client Lib : quarkus-reactive-pg-client

So when the db connection is lost while the service is running and the service receives a request , the app is throwing NoStackTraceThrowable exception. This is a generic exception and is preventing from custom handling of db connectivity issue. Like if u want add DB connect exception to circuit breaker

How can we get a dedicated exception for db communication issue ?

Exception :

ERROR [co.he.da.ex.APIExceptionHandler] (vert.x-eventloop-thread-0) NoStackTraceThrowable Exception: io.vertx.core.impl.NoStackTraceThrowable: Fail to read any response from the server, the underlying connection might get lost unexpectedly.

WARN [io.qu.re.da.ru.ReactiveDatasourceHealthCheck] (vert.x-eventloop-thread-3) Error obtaining database connection for healthcheck of datasource '': io.vertx.core.impl.NoStackTraceThrowable: Fail to read any response from the server, the underlying connection might get lost unexpectedly.

1

There are 1 best solutions below

2
On

Currently there is no other possibility than inspecting the exception message.

Please file an issue to the sql-client-repo to discuss a possible enhancement.