File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,9 @@ def _make_request(
156156 HTML page with the text "Oops, an error occurred". This has
157157 been seen to happen when the given name includes a bad
158158 character.
159+ json.decoder.JSONDecodeError: The server did not respond with valid
160+ JSON. This may happen if the server address is not a valid
161+ Vuforia server.
159162 """
160163 response = _target_api_request (
161164 server_access_key = self ._server_access_key ,
@@ -166,11 +169,10 @@ def _make_request(
166169 base_vws_url = self ._base_vws_url ,
167170 )
168171
169- try :
170- result_code = response .json ()['result_code' ]
171- except json .decoder .JSONDecodeError as exc :
172- assert 'Oops' in response .text , response .text
173- raise UnknownVWSErrorPossiblyBadName () from exc
172+ if 'Oops, an error occurred' in response .text :
173+ raise UnknownVWSErrorPossiblyBadName
174+
175+ result_code = response .json ()['result_code' ]
174176
175177 if result_code == expected_result_code :
176178 return response
You can’t perform that action at this time.
0 commit comments