diff --git a/src/main/java/org/embulk/util/config/Compat.java b/src/main/java/org/embulk/util/config/Compat.java index e8ad29d..971e6a0 100644 --- a/src/main/java/org/embulk/util/config/Compat.java +++ b/src/main/java/org/embulk/util/config/Compat.java @@ -105,6 +105,10 @@ private static Optional callToJsonIfAvailable(final DataSource source) { jsonStringObject = toJson.invoke(source); } catch (final InvocationTargetException ex) { final Throwable targetException = ex.getTargetException(); + if (targetException instanceof UnsupportedOperationException) { + // If the plugin's embulk-util-config does not implement toJson, it cannot retrieve a stringified JSON. + return Optional.empty(); + } if (targetException instanceof RuntimeException) { throw (RuntimeException) targetException; }