calimero-project / calimero-core

Core library for KNX network access and management
Other
126 stars 64 forks source link

Throws Exception when EventListener catch one #115

Closed bgrand-Lam closed 1 year ago

bgrand-Lam commented 1 year ago

When the EventListener catches an exception, it is not possible to know if the listener is removed. And at this point the KNX service can't work after that.

The proposal is to throw an exception when it appears. And this exception can be caught on the override method of ProcessListener or in a special method "detachListener".

If a another method to know if the listener is removed I would love to hear about it.

Calimero version : 2.5

bmalinowsky commented 1 year ago

Why don't you catch your exceptions directly in the event listener?

bgrand-Lam commented 1 year ago

Yes, after a few tries, it is now good. The problem is that the exception is a KNXRuntimeException and I have been caught KNXException. I thought the KNXException was the parent.