Skip to content

Commit 42197c9

Browse files
committed
add sqlState null check
1 parent 9291ccf commit 42197c9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

database-commons/src/main/java/io/cdap/plugin/db/DBErrorDetailsProvider.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ private ProgramFailureException getProgramFailureException(SQLException e, Error
7777
errorMessageWithDetails = String.format("%s For more details, see %s", errorMessageWithDetails,
7878
externalDocumentationLink);
7979
}
80-
return ErrorUtils.getProgramFailureException(getErrorCategoryFromSqlState(sqlState), errorMessage,
81-
errorMessageWithDetails, getErrorTypeFromErrorCode(errorCode, sqlState), false, ErrorCodeType.SQLSTATE,
82-
sqlState, externalDocumentationLink, e);
80+
return ErrorUtils.getProgramFailureException(sqlState == null ?
81+
new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN) : getErrorCategoryFromSqlState(sqlState),
82+
errorMessage, errorMessageWithDetails, getErrorTypeFromErrorCode(errorCode, sqlState), false,
83+
ErrorCodeType.SQLSTATE, sqlState, externalDocumentationLink, e);
8384
}
8485

8586
/**

0 commit comments

Comments
 (0)