justinmclean commented on code in PR #8513:
URL: https://github.com/apache/gravitino/pull/8513#discussion_r2342165587


##########
catalogs/catalog-jdbc-postgresql/src/main/java/org/apache/gravitino/catalog/postgresql/converter/PostgreSqlExceptionConverter.java:
##########
@@ -44,8 +44,12 @@ public GravitinoRuntimeException 
toGravitinoException(SQLException se) {
           return new NoSuchSchemaException(se.getMessage(), se);
         case "42P01":
           return new NoSuchTableException(se.getMessage(), se);
-        default:
+        default: {
+          if (se.getSQLState().startsWith("08")) {
+            return new ConnectionFailedException(se.getMessage(), se);
+          }
           return new GravitinoRuntimeException(se.getMessage(), se);
+        }

Review Comment:
   The 08 class of errors are connection exceptions, so 
ConnectionFailedException seems to be the correct one to me. Please see 
https://www.postgresql.org/docs/current/errcodes-appendix.html:
   
   Class 08 — Connection Exception
   08000 | connection_exception
   08003 | connection_does_not_exist
   08006 | connection_failure
   08001 | sqlclient_unable_to_establish_sqlconnection
   08004 | sqlserver_rejected_establishment_of_sqlconnection
   08007 | transaction_resolution_unknown
   08P01 | protocol_violation
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to