FreeOpcUa / opcua-asyncio

OPC UA library for python >= 3.7
GNU Lesser General Public License v3.0
1.04k stars 346 forks source link

Generic Exceptions #1565

Open HerrMuellerluedenscheid opened 5 months ago

HerrMuellerluedenscheid commented 5 months ago

RuntimeError is used in several places. That is a rather generic exception which, if sub-classed instead would allow more fine grained error handling. E.g.: https://github.com/FreeOpcUa/opcua-asyncio/blob/3268568df3b2c314920d97bb059cc48b3a98d5a1/asyncua/common/structures104.py#L219

How about introducing a DataType(Exception) in that case and similar exceptions in other cases?

oroulet commented 5 months ago

Yes. MR welcome 😁

oroulet commented 5 months ago

but inherit UaError so somone can catch all of these. There are already a few custom errors defined in some file