fanucpy icon indicating copy to clipboard operation
fanucpy copied to clipboard

Library-specific exception

Open ZdenekM opened this issue 2 years ago • 0 comments

Right now, the handle_response raises Exception: https://github.com/torayeff/fanucpy/blob/27a70d1c19f610f37cc196c7e97b1d682f37167e/src/fanucpy/Robot.py#L61

which is probably not a good practice. I propose to define at least one library-specific exception and optionally other derived exceptions... Something like this:

class FanucPyException(Exception):
    pass

class CommException(FanucPyException)
    pass

Which will allow me (in the application code) to catch just the specific exception raised by the library, instead of the generic one.

Thanks for your consideration.

ZdenekM avatar May 16 '22 07:05 ZdenekM