File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -79,19 +79,20 @@ def _interface_name_to_common_name(interface_name):
7979 raise StratisCliUnknownInterfaceError (interface_name ) # pragma: no cover
8080
8181
82- def get_errors (exc : Exception ):
82+ def get_errors (exc : BaseException ):
8383 """
8484 Generates a sequence of exceptions starting with exc and following the chain
8585 of causes.
8686 """
87- while True :
88- yield exc
89- exc = getattr (exc , "__cause__" ) or getattr (exc , "__context__" )
90- if exc is None :
91- return
87+ yield exc
88+ while exc .__cause__ is not None :
89+ yield exc .__cause__
90+ exc = exc .__cause__
9291
9392
94- def _interpret_errors_0 (error ):
93+ def _interpret_errors_0 (
94+ error : dbus .exceptions .DBusException ,
95+ ):
9596 """
9697 Handle match on SCAE .* DBE
9798 where:
@@ -121,7 +122,10 @@ def _interpret_errors_0(error):
121122 # running with a new major version and is supplying a different name on the
122123 # D-Bus than stratis is attempting to use. The second and third
123124 # possibilities are both covered by a single error message.
124- if error .get_dbus_name () == "org.freedesktop.DBus.Error.NameHasNoOwner" :
125+ if error .get_dbus_name () in (
126+ "org.freedesktop.DBus.Error.NameHasNoOwner" ,
127+ "org.freedesktop.DBus.Error.ServiceUnknown" ,
128+ ):
125129 try :
126130 # pylint: disable=import-outside-toplevel
127131 # isort: THIRDPARTY
You can’t perform that action at this time.
0 commit comments