From 34f85c697cdfb9812497faea5932a1bc99402e13 Mon Sep 17 00:00:00 2001 From: AMit-Cloudsufi Date: Fri, 24 Jan 2025 07:34:12 +0000 Subject: [PATCH] File error message update --- .../src/main/java/io/cdap/plugin/batch/sink/FileSink.java | 5 ++--- .../java/io/cdap/plugin/batch/source/FileSourceConfig.java | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core-plugins/src/main/java/io/cdap/plugin/batch/sink/FileSink.java b/core-plugins/src/main/java/io/cdap/plugin/batch/sink/FileSink.java index e2fffcc93..6d8bb0afa 100644 --- a/core-plugins/src/main/java/io/cdap/plugin/batch/sink/FileSink.java +++ b/core-plugins/src/main/java/io/cdap/plugin/batch/sink/FileSink.java @@ -107,9 +107,8 @@ private Map getFSProperties() { try { return GSON.fromJson(fileSystemProperties, MAP_TYPE); } catch (JsonSyntaxException e) { - String errorMessage = String.format( - "Failed to parse filesystem properties %s with message: %s: %s", fileSystemProperties, - e.getClass().getName(), e.getMessage()); + String errorMessage = String.format("Failed to parse filesystem properties %s, %s: %s", + fileSystemProperties, e.getClass().getName(), e.getMessage()); throw ErrorUtils.getProgramFailureException( new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN), errorMessage, errorMessage, ErrorType.USER, false, e); diff --git a/core-plugins/src/main/java/io/cdap/plugin/batch/source/FileSourceConfig.java b/core-plugins/src/main/java/io/cdap/plugin/batch/source/FileSourceConfig.java index 5aa97d890..30a6022fa 100644 --- a/core-plugins/src/main/java/io/cdap/plugin/batch/source/FileSourceConfig.java +++ b/core-plugins/src/main/java/io/cdap/plugin/batch/source/FileSourceConfig.java @@ -124,7 +124,9 @@ Map getFileSystemProperties() { try { return GSON.fromJson(fileSystemProperties, MAP_STRING_STRING_TYPE); } catch (Exception e) { - throw new IllegalArgumentException(String.format("Unable to parse filesystem properties: %s", e.getMessage()), e); + throw new IllegalArgumentException( + String.format("Unable to parse filesystem properties, %s: %s", e.getClass().getName(), + e.getMessage()), e); } }