Skip to content

Commit

Permalink
raise exception
Browse files Browse the repository at this point in the history
  • Loading branch information
chemelnucfin committed Dec 20, 2017
1 parent 3a2767d commit cd6d131
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions spanner/google/cloud/spanner_v1/database.py
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions spanner/tests/system/test_system.py
Expand Up @@ -284,6 +284,7 @@ def test_create_database(self):

def test_table_not_found(self):
table = 'yTable'
temp_db_id = 'temp_db' + unique_resource_id('_')
temp_db = Config.INSTANCE.database(temp_db_id, ddl_statements=[
'CREATE TABLE MyTable ('
' Id STRING(36) NOT NULL,'
Expand Down

0 comments on commit cd6d131

Please sign in to comment.