From 28065afbf44cd2f2a5f5fd894f1248133440024e Mon Sep 17 00:00:00 2001 From: Jack Caperon Date: Wed, 4 Oct 2023 10:05:49 +1100 Subject: [PATCH 1/2] Log exception instead of message Currently when an error is encountered its entirely possible for an exception to have been thrown with no message. This means we end up with logs that look like: `Exception encountered during file upload: ` This makes the log line largely useless for debugging purposes. --- .../net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java index 543e8a7f5..c78023cfc 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java @@ -2088,7 +2088,7 @@ public static void uploadWithoutConnection(SnowflakeFileTransferConfig config) t break; } } catch (Exception ex) { - logger.error("Exception encountered during file upload: ", ex.getMessage()); + logger.error("Exception encountered during file upload: ", ex); throw ex; } finally { if (fileBackedOutputStream != null) { From ab313969251c215208f30175a84051aba5fe5baa Mon Sep 17 00:00:00 2001 From: Jack Caperon Date: Wed, 4 Oct 2023 10:07:28 +1100 Subject: [PATCH 2/2] Update SnowflakeFileTransferAgent.java --- .../net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java index c78023cfc..2f2b7df5e 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java @@ -2088,7 +2088,7 @@ public static void uploadWithoutConnection(SnowflakeFileTransferConfig config) t break; } } catch (Exception ex) { - logger.error("Exception encountered during file upload: ", ex); + logger.error("Exception encountered during file upload.", ex); throw ex; } finally { if (fileBackedOutputStream != null) {