@@ -75,7 +75,7 @@ def execute(self, query, params=None, timeout=10.0):
7575 labelbox.exceptions.InvalidQueryError: If `query` is not
7676 syntactically or semantically valid (checked server-side).
7777 labelbox.exceptions.ApiLimitError: If the server API limit was
78- exceeded. See "How to import data" in the online documentation
78+ exceeded. See "How to import data" in the online documentation
7979 to see API limits.
8080 labelbox.exceptions.TimeoutError: If response was not received
8181 in `timeout` seconds.
@@ -112,14 +112,14 @@ def convert_value(value):
112112 raise labelbox .exceptions .NetworkError (e )
113113
114114 except Exception as e :
115- logger . error ( "Unknown error: %s" , str ( e ))
116- raise labelbox . exceptions . LabelboxError ( str (e ))
115+ raise labelbox . exceptions . LabelboxError (
116+ "Unknown error during Client.query(): " + str (e ), e )
117117
118118 try :
119119 response = response .json ()
120120 except :
121121 raise labelbox .exceptions .LabelboxError (
122- "Failed to parse response as JSON: %s" , response .text )
122+ "Failed to parse response as JSON: %s" % response .text )
123123
124124 errors = response .get ("errors" , [])
125125
@@ -173,7 +173,7 @@ def check_errors(keywords, *path):
173173
174174 def upload_data (self , data ):
175175 """ Uploads the given data (bytes) to Labelbox.
176-
176+
177177 Args:
178178 data (bytes): The data to upload.
179179 Returns:
@@ -199,9 +199,9 @@ def upload_data(self, data):
199199
200200 try :
201201 file_data = response .json ().get ("data" , None )
202- except ValueError : # response is not valid JSON
202+ except ValueError as e : # response is not valid JSON
203203 raise labelbox .exceptions .LabelboxError (
204- "Failed to upload, unknown cause" )
204+ "Failed to upload, unknown cause" , e )
205205
206206 if not file_data or not file_data .get ("uploadFile" , None ):
207207 raise labelbox .exceptions .LabelboxError (
0 commit comments