File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/main/java/io/supertokens/storage/postgresql Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,10 @@ public <T> T startTransaction(TransactionLogic<T> logic)
168168 } else if (e instanceof StorageTransactionLogicException ) {
169169 actualException = ((StorageTransactionLogicException ) e ).actualException ;
170170 }
171+ String exceptionMessage = actualException .getMessage ();
172+ if (exceptionMessage == null ) {
173+ exceptionMessage = "" ;
174+ }
171175 // see: https://github.com/supertokens/supertokens-postgresql-plugin/pull/3
172176
173177 // We set this variable to the current (or cause) exception casted to PSQLException if we can safely
@@ -184,12 +188,11 @@ public <T> T startTransaction(TransactionLogic<T> logic)
184188 // We could get here if the new logic hits a false negative, e.g., in case someone renamed
185189 // constraints/tables
186190 boolean isDeadlockException = actualException instanceof SQLTransactionRollbackException
187- || actualException .getMessage ().toLowerCase ().contains ("concurrent update" ) || actualException
188- .getMessage ().toLowerCase ().contains ("the transaction might succeed if retried" )
189- ||
191+ || exceptionMessage .toLowerCase ().contains ("concurrent update" )
192+ || exceptionMessage .toLowerCase ().contains ("the transaction might succeed if retried" ) ||
190193
191194 // we have deadlock as well due to the DeadlockTest.java
192- actualException . getMessage () .toLowerCase ().contains ("deadlock" );
195+ exceptionMessage .toLowerCase ().contains ("deadlock" );
193196
194197 if ((isPSQLRollbackException || isDeadlockException ) && tries < 3 ) {
195198 try {
You can’t perform that action at this time.
0 commit comments