Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Commit 6955786

Browse files
committed
Cleans up error messages in devicetool
Bug: 69009843 Change-Id: I7b3c6acd34911189df7ece3e4a10febbc4d85435
1 parent 8e1c653 commit 6955786

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@ def failed_request_exception(message, r):
2727
"""Build ClickException from a failed request."""
2828
try:
2929
resp = json.loads(r.text)
30-
message = '%s: %d %s' % (message,
31-
resp['error']['code'],
32-
resp['error']['message'])
33-
if 'details' in resp['error']:
34-
details = '\n'.join(d['detail'] for d in resp['error']['details'])
35-
message += ' ' + details
30+
message = '%s: %d\n%s' % (message, resp['error']['code'],
31+
resp['error']['message'])
3632
return click.ClickException(message)
3733
except ValueError:
3834
# fallback on raw text response if error is not structured.

0 commit comments

Comments
 (0)