You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/10/07 13:30:29 UTC

[GitHub] [kafka] C0urante commented on a change in pull request #11384: MINOR: Improve error message for scale mismatch in Connect logical Decimal types

C0urante commented on a change in pull request #11384:
URL: https://github.com/apache/kafka/pull/11384#discussion_r724182155



##########
File path: connect/api/src/main/java/org/apache/kafka/connect/data/Decimal.java
##########
@@ -64,8 +64,14 @@ public static Schema schema(int scale) {
      * @return the encoded value
      */
     public static byte[] fromLogical(Schema schema, BigDecimal value) {
-        if (value.scale() != scale(schema))
-            throw new DataException("BigDecimal has mismatching scale value for given Decimal schema");
+        int schemaScale = scale(schema);
+        if (value.scale() != schemaScale)
+            throw new DataException(String.format(
+                "BigDecimal has mismatching scale value for given Decimal schema. "

Review comment:
       I tried to keep the same log message as before but just append new information to it. Agree that `BigDecimal` is a detail that people reading only logs (as opposed to logs in conjunction with source code) won't benefit from; can adjust accordingly.




-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org