Skip to content

Commit e567811

Browse files
author
Korney Gedert
committed
Catch exceptions from Apt_applier
1 parent 2d8877b commit e567811

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

gpoa/apt1_runner

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,20 @@ if __name__ == '__main__':
9999

100100
args = parser.parse_args()
101101
logger.setLevel(args.loglevel)
102-
if args.user:
103-
applier = Apt_applier(args.user)
104-
else:
105-
applier = Apt_applier()
106-
applier.apply()
102+
103+
try:
104+
if args.user:
105+
applier = Apt_applier(args.user)
106+
else:
107+
applier = Apt_applier()
108+
except dbus.exceptions.DBusException as e:
109+
# TODO: add connection error logging.
110+
pass
111+
112+
try:
113+
if applier.apply() != 0:
114+
# TODO: add error logging.
115+
pass
116+
except dbus.exceptions.DBusException as exc:
117+
# TODO: add dbus internal error logging.
118+
pass

0 commit comments

Comments
 (0)