File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 3333from googleapiclient .discovery import DISCOVERY_URI
3434from googleapiclient .discovery import build
3535from googleapiclient .discovery import build_from_document
36+ from googleapiclient .discovery import UnknownApiNameOrVersion
3637import httplib2
3738import 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 , {
You can’t perform that action at this time.
0 commit comments