Skip to content

Commit 6bd8e3d

Browse files
committed
Wrap Unsupported datatype error
1 parent 83499df commit 6bd8e3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,9 @@ private void writeToDataOut(DataOutput out, Schema.Field field) throws IOExcepti
372372
out.write((byte[]) fieldValue);
373373
break;
374374
default:
375-
throw new IOException(String.format("Unsupported datatype: %s with value: %s.", fieldType, fieldValue));
375+
String errorMessage = String.format("Unsupported datatype: %s with value: %s.", fieldType, fieldValue);
376+
throw ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN),
377+
errorMessage, errorMessage, ErrorType.USER, false, new IOException(errorMessage));
376378
}
377379
}
378380

0 commit comments

Comments
 (0)