On Mon, Oct 14, 2019 at 01:12:46PM +0200, Jan Tluka wrote:
Fri, Oct 11, 2019 at 04:43:29PM CEST, olichtne(a)redhat.com wrote:
>From: Ondrej Lichtner <olichtne(a)redhat.com>
> def create_device(self, clsname, args=[], kwargs={}):
> dev = self._if_manager.create_device(clsname, args, kwargs)
>- if dev is None:
>- raise Exception("Device creation failed")
Just wondering if the change of the exception class matters here. If the
DeviceError is excepted somewhere upper in the stack, I'd keep it.
I'd like to refactor the whole lnst to only raise exceptions that
inherit from LnstError with different messages/types to indicate the
problem so that we have an easier time tracking down what is broken/what
is just an error to report to a user.
If there's a generic "except Exception" somewhere higher in the stack
(so on the Controller since this is quite close to the top of the Slave)
then that should probably be treated as a bug and addressed.
-Ondrej