From 6f63dc42d3d1f0f651776e2b263f14d0e4f359e2 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Tue, 19 Dec 2017 16:37:07 -0800 Subject: [PATCH] raise exception --- spanner/google/cloud/spanner_v1/database.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spanner/google/cloud/spanner_v1/database.py b/spanner/google/cloud/spanner_v1/database.py index 8a94ad9fb6d7..dfdeda1d8a29 100644 --- a/spanner/google/cloud/spanner_v1/database.py +++ b/spanner/google/cloud/spanner_v1/database.py @@ -210,11 +210,7 @@ def create(self): ) except GaxError as exc: exception = exceptions.from_grpc_error(exc.cause) - if exception.grpc_status_code == StatusCode.ALREADY_EXISTS: - raise Conflict(self.name) - elif exception.grpc_status_code == StatusCode.NOT_FOUND: - raise exception.errors[0] - raise + raise exception return future def exists(self):