pgjdbc-ng icon indicating copy to clipboard operation
pgjdbc-ng copied to clipboard

Endlessly recursive error handling (0.8.9)

Open powczarek22 opened this issue 3 years ago • 0 comments

https://github.com/impossibl/pgjdbc-ng/blob/develop/driver/src/main/java/com/impossibl/postgres/jdbc/ErrorUtils.java

Pass an instance of NoticeException and it loops until stack overflow

public static SQLException makeSQLException(String message, Exception cause) {

    if (cause instanceof SQLException) {
      return (SQLException) cause;
    }

    if (cause instanceof NoticeException) {
      return makeSQLException(message, cause);
    }

    return new PGSQLSimpleException(message, cause);
  }

powczarek22 avatar Feb 10 '22 09:02 powczarek22