aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Wayne Parrott <jon.wayne.parrott@gmail.com>2016-02-19 16:02:04 -0800
committerJon Wayne Parrott <jon.wayne.parrott@gmail.com>2016-02-19 16:25:50 -0800
commitfd2f99c7fb3cb577f0ecc4a6e2131e54a4c36f31 (patch)
tree6e045755c1b5428d36108ef4ba7cdee96425487a
parent54b203aecfcfda41d5427cde7d586cbc5c233685 (diff)
downloadgoogle-api-python-client-fd2f99c7fb3cb577f0ecc4a6e2131e54a4c36f31.tar.gz
Fix issue where docs would fail to build if an API is whitelisted.
-rwxr-xr-xdescribe.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/describe.py b/describe.py
index 5dcac904c..c5b15a745 100755
--- a/describe.py
+++ b/describe.py
@@ -33,6 +33,7 @@ import sys
from googleapiclient.discovery import DISCOVERY_URI
from googleapiclient.discovery import build
from googleapiclient.discovery import build_from_document
+from googleapiclient.discovery import UnknownApiNameOrVersion
import httplib2
import uritemplate
@@ -339,7 +340,12 @@ def document_api(name, version):
name: string, Name of the API.
version: string, Version of the API.
"""
- service = build(name, version)
+ try:
+ service = build(name, version)
+ except UnknownApiNameOrVersion as e:
+ print 'Warning: {} {} found but could not be built.'.format(name, version)
+ return
+
response, content = http.request(
uritemplate.expand(
FLAGS.discovery_uri_template, {