diff --git a/google-cloud-examples/src/main/java/com/google/cloud/examples/spanner/snippets/DatabaseAdminClientSnippets.java b/google-cloud-examples/src/main/java/com/google/cloud/examples/spanner/snippets/DatabaseAdminClientSnippets.java index 9e01b445064b..5afb07ba5f72 100644 --- a/google-cloud-examples/src/main/java/com/google/cloud/examples/spanner/snippets/DatabaseAdminClientSnippets.java +++ b/google-cloud-examples/src/main/java/com/google/cloud/examples/spanner/snippets/DatabaseAdminClientSnippets.java @@ -74,9 +74,9 @@ public Database createDatabase(String instanceId, String databaseId) { Database db; try { db = op.get(); - } catch (Exception e) { - throw SpannerExceptionFactory.newSpannerException(e); - } + } catch (ExecutionException | InterruptedException e) { + throw e.getCause(); + } // [END createDatabase] return db; }