Skip to content

Commit

Permalink
Fix issue where docs would fail to build if an API is whitelisted.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Wayne Parrott committed Feb 20, 2016
1 parent 54b203a commit fd2f99c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
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

Expand Down Expand Up @@ -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, {
Expand Down

0 comments on commit fd2f99c

Please sign in to comment.