Skip to content

Commit 4e3ab66

Browse files
authored
Fix | SonarQube changes
SonarQube changes
1 parent 99138fa commit 4e3ab66

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -2561,11 +2561,12 @@ else if (4 >= bulkScale)
25612561
// this should not really happen, since ClassCastException should only happen when colValue is not null.
25622562
// just do one more checking here to make sure
25632563
throwInvalidArgument("colValue");
2564+
} else {
2565+
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_errorConvertingValue"));
2566+
Object[] msgArgs = {colValue.getClass().getSimpleName(), JDBCType.of(bulkJdbcType)};
2567+
throw new SQLServerException(form.format(msgArgs), SQLState.DATA_EXCEPTION_NOT_SPECIFIC,
2568+
DriverError.NOT_SET, ex);
25642569
}
2565-
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_errorConvertingValue"));
2566-
Object[] msgArgs = {colValue.getClass().getSimpleName(), JDBCType.of(bulkJdbcType)};
2567-
throw new SQLServerException(form.format(msgArgs), SQLState.DATA_EXCEPTION_NOT_SPECIFIC,
2568-
DriverError.NOT_SET, ex);
25692570
}
25702571
}
25712572

0 commit comments

Comments
 (0)