File tree Expand file tree Collapse file tree
cloudify_cli/async_commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
22import json
33
4+ import aiohttp .client_exceptions
5+
46from cloudify_cli .exceptions import CloudifyCliError
57from cloudify_cli .logger import get_global_json_output
68
@@ -34,12 +36,15 @@ async def _stream_logs(creator_name,
3436 creator_name = creator_name ,
3537 execution_id = execution_id ,
3638 since = since )
37- async for data in response .content :
38- for audit_log in _streamed_audit_log (data ):
39- if get_global_json_output ():
40- print (audit_log )
41- else :
42- print (_format_audit_log (audit_log ))
39+ try :
40+ async for data in response .content :
41+ for audit_log in _streamed_audit_log (data ):
42+ if get_global_json_output ():
43+ print (audit_log )
44+ else :
45+ print (_format_audit_log (audit_log ))
46+ except aiohttp .client_exceptions .ClientError as e :
47+ raise CloudifyCliError (f'Error getting audit log stream: { e } ' ) from e
4348
4449
4550def _streamed_audit_log (data ):
You can’t perform that action at this time.
0 commit comments