Skip to content

Commit c796fca

Browse files
committed
Add better error handling to print errors from spreadsheet login.
1 parent a9ce0d5 commit c796fca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/google_spreadsheet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ def login_open_sheet(oauth_key_file, spreadsheet):
8888
gc = gspread.authorize(credentials)
8989
worksheet = gc.open(spreadsheet).sheet1
9090
return worksheet
91-
except:
91+
except Exception as ex:
9292
print 'Unable to login and get spreadsheet. Check OAuth credentials, spreadsheet name, and make sure spreadsheet is shared to the client_email address in the OAuth .json file!'
93+
print 'Google sheet login failed with error:', ex
9394
sys.exit(1)
9495

9596

0 commit comments

Comments
 (0)