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 33
33
from googleapiclient .discovery import DISCOVERY_URI
34
34
from googleapiclient .discovery import build
35
35
from googleapiclient .discovery import build_from_document
36
+ from googleapiclient .discovery import UnknownApiNameOrVersion
36
37
import httplib2
37
38
import uritemplate
38
39
@@ -339,7 +340,12 @@ def document_api(name, version):
339
340
name: string, Name of the API.
340
341
version: string, Version of the API.
341
342
"""
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
+
343
349
response , content = http .request (
344
350
uritemplate .expand (
345
351
FLAGS .discovery_uri_template , {
You can’t perform that action at this time.
0 commit comments