From 715a9b576959dda7bc62270db853b80db57e1c5a Mon Sep 17 00:00:00 2001 From: hantmac Date: Fri, 30 Aug 2024 14:21:27 +0800 Subject: [PATCH] fix: add more exception info --- .../src/main/java/com/databend/jdbc/DatabendConnection.java | 1 - .../src/main/java/com/databend/jdbc/PresignContext.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/databend-jdbc/src/main/java/com/databend/jdbc/DatabendConnection.java b/databend-jdbc/src/main/java/com/databend/jdbc/DatabendConnection.java index d653aed9..a09e476f 100644 --- a/databend-jdbc/src/main/java/com/databend/jdbc/DatabendConnection.java +++ b/databend-jdbc/src/main/java/com/databend/jdbc/DatabendConnection.java @@ -766,7 +766,6 @@ public void uploadStream(String stageName, String destPrefix, InputStream inputS } } catch (RuntimeException e) { System.out.println(e.getMessage()); - // For datax batch insert test, do not throw exception throw new SQLException(e); } catch (IOException e) { logger.warning("failed to upload input stream, file size is:" + fileSize / 1024.0 + e.getMessage()); diff --git a/databend-jdbc/src/main/java/com/databend/jdbc/PresignContext.java b/databend-jdbc/src/main/java/com/databend/jdbc/PresignContext.java index 2a69ff07..3f7d3bbf 100644 --- a/databend-jdbc/src/main/java/com/databend/jdbc/PresignContext.java +++ b/databend-jdbc/src/main/java/com/databend/jdbc/PresignContext.java @@ -40,7 +40,7 @@ public static void dropStageIfExists(DatabendConnection connection, String stage } public static PresignContext getPresignContext(DatabendConnection connection, PresignMethod method, String stageName, String fileName) - throws SQLException { + throws SQLException { requireNonNull(connection, "connection is null"); requireNonNull(method, "method is null"); Statement statement = connection.createStatement(); @@ -60,7 +60,7 @@ public static PresignContext getPresignContext(DatabendConnection connection, Pr throw new SQLException("Failed to get presign url"); } } catch (Throwable e) { - throw new SQLException("Failed to do presign"); + throw new SQLException("Failed to do presign. Exception: " + e.toString(), e); } finally { statement.close(); }