@@ -243,8 +243,8 @@ public String getStreamName() {
243243 }
244244
245245 /**
246- * This exception is thrown from {@link JsonStreamWriter #append()} when the client side Json to
247- * Proto serializtion fails. It can also be thrown by the server in case rows contains invalid
246+ * This exception is thrown from {@link SchemaAwareStreamWriter #append()} when the client side
247+ * Proto serialization fails. It can also be thrown by the server in case rows contains invalid
248248 * data. The exception contains a Map of indexes of faulty rows and the corresponding error
249249 * message.
250250 */
@@ -362,16 +362,27 @@ protected InflightBytesLimitExceededException(String writerId, long currentLimit
362362 currentLimit );
363363 }
364364 }
365+
365366 /**
366- * Input Json data has unknown field to the schema of the JsonStreamWriter. User can either turn
367- * on IgnoreUnknownFields option on the JsonStreamWriter, or if they don't want the error to be
368- * ignored, they should recreate the JsonStreamWriter with the updated table schema.
367+ * This class is replaced by a generic one. It will be removed soon. Please use {@link
368+ * DataHasUnknownFieldException}
369369 */
370- public static final class JsonDataHasUnknownFieldException extends IllegalArgumentException {
370+ public static final class JsonDataHasUnknownFieldException extends DataHasUnknownFieldException {
371+ protected JsonDataHasUnknownFieldException (String jsonFieldName ) {
372+ super (jsonFieldName );
373+ }
374+ }
375+ /**
376+ * Input data object has unknown field to the schema of the SchemaAwareStreamWriter. User can
377+ * either turn on IgnoreUnknownFields option on the SchemaAwareStreamWriter, or if they don't want
378+ * the error to be ignored, they should recreate the SchemaAwareStreamWriter with the updated
379+ * table schema.
380+ */
381+ public static class DataHasUnknownFieldException extends IllegalArgumentException {
371382 private final String jsonFieldName ;
372383
373- protected JsonDataHasUnknownFieldException (String jsonFieldName ) {
374- super (String .format ("JSONObject has fields unknown to BigQuery: %s." , jsonFieldName ));
384+ public DataHasUnknownFieldException (String jsonFieldName ) {
385+ super (String .format ("The source object has fields unknown to BigQuery: %s." , jsonFieldName ));
375386 this .jsonFieldName = jsonFieldName ;
376387 }
377388
0 commit comments