Do NOT check SQL states when catching `DataAccessException` in the FASTEN server
@@ -356,13 +356,9 @@ public class FastenKafkaPlugin implements FastenServerPlugin {
throw e;
} catch (DataAccessException e) {
- // The error codes starting with 57P0 are related to the DB connection issues.
- // See https://www.postgresql.org/docs/current/errcodes-appendix.html
- if (e.sqlState().contains("57P0")) {
- throw new UnrecoverableError("Could not connect to the Postgres DB and the plug-in should be stopped and restarted.",
+ // Database-related errors
+ throw new UnrecoverableError("Could not connect to or query the Postgres DB and the plug-in should be stopped and restarted.",
e.getCause());
- }
- plugin.setPluginError(e);
} catch (Exception e) {
logger.error("An error occurred in " + plugin.getClass().getCanonicalName(), e);
plugin.setPluginError(e);
