wrap notification process in try catch and capture stderr data
parent
209e1085ae
commit
6fa266e3e0
piker/ui
|
@ -82,7 +82,6 @@ async def notify_from_ems_status_msg(
|
||||||
os.environ['DBUS_SESSION_BUS_ADDRESS'] = (
|
os.environ['DBUS_SESSION_BUS_ADDRESS'] = (
|
||||||
f'unix:path=/run/user/{_dbus_uid}/bus'
|
f'unix:path=/run/user/{_dbus_uid}/bus'
|
||||||
)
|
)
|
||||||
|
|
||||||
result = await trio.run_process(
|
result = await trio.run_process(
|
||||||
[
|
[
|
||||||
'notify-send',
|
'notify-send',
|
||||||
|
@ -94,5 +93,16 @@ async def notify_from_ems_status_msg(
|
||||||
# pack in a broker independent way?
|
# pack in a broker independent way?
|
||||||
f"'{msg.pformat()}'",
|
f"'{msg.pformat()}'",
|
||||||
],
|
],
|
||||||
|
capture_stdout=True,
|
||||||
|
capture_stderr=True,
|
||||||
|
check=False,
|
||||||
)
|
)
|
||||||
|
if result.returncode != 0:
|
||||||
|
log.warn(f'No notification daemon installed stderr: {result.stderr}')
|
||||||
|
|
||||||
|
|
||||||
log.runtime(result)
|
log.runtime(result)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue