Skip to content

Commit 2f94976

Browse files
authored
Fix: Return entire stack trace for deadline exceeded error (#347)
* Use original exception rather than message only * Use original exception rather than message only
1 parent 2ac1964 commit 2f94976

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/google/cloud/spanner/jdbc/JdbcSqlExceptionFactory.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ public static class JdbcSqlTimeoutException extends SQLTimeoutException
6868
implements JdbcSqlException {
6969
private static final long serialVersionUID = 2363793358642102814L;
7070

71+
private JdbcSqlTimeoutException(SpannerException e) {
72+
super(e.getMessage(), "Timed out", Code.DEADLINE_EXCEEDED_VALUE, e);
73+
}
74+
7175
private JdbcSqlTimeoutException(String message) {
7276
super(message, "Timed out", Code.DEADLINE_EXCEEDED_VALUE);
7377
}
@@ -188,7 +192,7 @@ static SQLException of(SpannerException e) {
188192
return new JdbcAbortedException((AbortedException) e);
189193
}
190194
case DEADLINE_EXCEEDED:
191-
return new JdbcSqlTimeoutException(e.getMessage());
195+
return new JdbcSqlTimeoutException(e);
192196
case ALREADY_EXISTS:
193197
case CANCELLED:
194198
case DATA_LOSS:

0 commit comments

Comments
 (0)