Skip to content

Commit fd2f99c

Browse files
author
Jon Wayne Parrott
committed
Fix issue where docs would fail to build if an API is whitelisted.
1 parent 54b203a commit fd2f99c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

describe.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from googleapiclient.discovery import DISCOVERY_URI
3434
from googleapiclient.discovery import build
3535
from googleapiclient.discovery import build_from_document
36+
from googleapiclient.discovery import UnknownApiNameOrVersion
3637
import httplib2
3738
import uritemplate
3839

@@ -339,7 +340,12 @@ def document_api(name, version):
339340
name: string, Name of the API.
340341
version: string, Version of the API.
341342
"""
342-
service = build(name, version)
343+
try:
344+
service = build(name, version)
345+
except UnknownApiNameOrVersion as e:
346+
print 'Warning: {} {} found but could not be built.'.format(name, version)
347+
return
348+
343349
response, content = http.request(
344350
uritemplate.expand(
345351
FLAGS.discovery_uri_template, {

0 commit comments

Comments
 (0)