Source:
<code>public void prepareRun(BatchSinkContext context) throws Exception { FailureCollector collector = context.getFailureCollector(); config.validate(collector); FileFormat fileFormat = config.getFormat(); ValidatingOutputFormat validatingOutputFormat; try { validatingOutputFormat = context.newPluginInstance(fileFormat.name().toLowerCase()); } catch (InvalidPluginConfigException e) { <START> LOG.error("Failed to create config for plugin missing properties: invalid properties: {}", <END> fileFormat.name(), e.getMissingProperties(), e.getInvalidProperties()); throw e; } FormatContext formatContext = new FormatContext(collector, context.getInputSchema()); validateOutputFormatProvider(formatContext, fileFormat, validatingOutputFormat); collector.getOrThrowException(); Schema schema = config.getSchema(); if (schema == null) { schema = context.getInputSchema(); } LineageRecorder lineageRecorder = new LineageRecorder(context, config.getReferenceName()); lineageRecorder.createExternalDataset(schema); if (schema != null && schema.getFields() != null && !schema.getFields().isEmpty()) { recordLineage(lineageRecorder, schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList())); } Map<String, String> outputProperties = new HashMap<>(validatingOutputFormat.getOutputFormatConfiguration()); outputProperties.putAll(getFileSystemProperties(context)); outputProperties.put(FileOutputFormat.OUTDIR, getOutputDir(context.getLogicalStartTime())); context.addOutput(Output.of(config.getReferenceName(), new SinkOutputFormatProvider(validatingOutputFormat.getOutputFormatClassName(), outputProperties))); }</code><technical_language>In general, avoid this type of pattern exception is caught, logged, re-thrown. ends happening is error logged caller, generating extra logs confusing user. Instead, wrap exception a more specific error message propagate up. like: throw new IllegalArgumentException("...", e); message give more information user do fix problem. This case happen format a macro, caused error in configurePipeline. a message be: Format '{}' properties provided invalid pipeline deployed. Set format a value, re-create pipeline required properties</technical_language>

Target:
public void prepareRun(BatchSinkContext context) throws Exception { FailureCollector collector = context.getFailureCollector(); config.validate(collector); FileFormat fileFormat = config.getFormat(); ValidatingOutputFormat validatingOutputFormat; try { validatingOutputFormat = context.newPluginInstance(fileFormat.name().toLowerCase()); } catch (InvalidPluginConfigException e) { Set<String> properties = new HashSet<>(e.getMissingProperties()); for (InvalidPluginProperty invalidProperty: e.getInvalidProperties()) { properties.add(invalidProperty.getName()); } String errorMessage = String.format("Format '%s' cannot be used because properties %s were not provided or " + "were invalid when the pipeline was deployed. Set the format to a " + "different value, or re-create the pipeline with all required properties.", fileFormat.name(), properties); throw new IllegalArgumentException(errorMessage, e); } FormatContext formatContext = new FormatContext(collector, context.getInputSchema()); validateOutputFormatProvider(formatContext, fileFormat, validatingOutputFormat); collector.getOrThrowException(); Schema schema = config.getSchema(); if (schema == null) { schema = context.getInputSchema(); } LineageRecorder lineageRecorder = new LineageRecorder(context, config.getReferenceName()); lineageRecorder.createExternalDataset(schema); if (schema != null && schema.getFields() != null && !schema.getFields().isEmpty()) { recordLineage(lineageRecorder, schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList())); } Map<String, String> outputProperties = new HashMap<>(validatingOutputFormat.getOutputFormatConfiguration()); outputProperties.putAll(getFileSystemProperties(context)); outputProperties.put(FileOutputFormat.OUTDIR, getOutputDir(context.getLogicalStartTime())); context.addOutput(Output.of(config.getReferenceName(), new SinkOutputFormatProvider(validatingOutputFormat.getOutputFormatClassName(), outputProperties))); }