Skip to content

Commit 8be2193

Browse files
committed
Add right error handling
1 parent 7609a6e commit 8be2193

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

dask_cloudprovider/gcp/instances.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import asyncio
2-
import os
32
import uuid
43
import json
54

6-
import sqlite3
75
from typing import Optional, Any, Dict
86

97
import dask
10-
from dask.utils import tmpfile
118
from dask_cloudprovider.generic.vmcluster import (
129
VMCluster,
1310
VMInterface,
@@ -672,11 +669,11 @@ def refresh_client(self):
672669
else:
673670
import google.auth
674671

675-
# Obtain Application Default Credentials
672+
# Obtain Application Default Credentials (ADC)
676673
try:
677674
credentials, _ = google.auth.default()
678-
except google.auth.exceptions.DefaultCredentialsError:
679-
credentials = None
675+
except google.auth.exceptions.DefaultCredentialsError as e:
676+
raise GCPCredentialsError() from e
680677

681678
# Use the credentials to build a service client
682679
return googleapiclient.discovery.build(

0 commit comments

Comments
 (0)