@@ -243,8 +243,8 @@ public String getStreamName() {
243
243
}
244
244
245
245
/**
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
248
248
* data. The exception contains a Map of indexes of faulty rows and the corresponding error
249
249
* message.
250
250
*/
@@ -362,16 +362,27 @@ protected InflightBytesLimitExceededException(String writerId, long currentLimit
362
362
currentLimit );
363
363
}
364
364
}
365
+
365
366
/**
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}
369
369
*/
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 {
371
382
private final String jsonFieldName ;
372
383
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 ));
375
386
this .jsonFieldName = jsonFieldName ;
376
387
}
377
388
0 commit comments