DarthAffe / RGB.NET

The one-stop SDK for RGB-peripherals
http://lib.arge.be
GNU Lesser General Public License v2.1
402 stars 72 forks source link

set ThrowsExceptions false after initialization #354

Open Aytackydln opened 1 year ago

Aytackydln commented 1 year ago

Problem: When provider is initialized with throwExceptions = true, UpdateQueue throws exceptions in thread-pool and crashes application

Hopefully this is an acceptable solution.

DarthAffe commented 1 year ago

This is an intended behavior - throwExceptions primarily meant as a debug-feature. If you want to listen to exceptions without them being thrown you should use the Exception event instead. (You can also selectively throw using this event.)

Aytackydln commented 1 year ago

Well using Exception event is the idea, actually. When initialized with throwExceptions Exception event isn't triggered. Maybe this should be a public property intead?

DarthAffe commented 1 year ago

When initialized with throwExceptions Exception event isn't triggered.

this would be a bug, but i just checked everything and I don't see any reason why it should be fired. Are you sure that's the case?

Aytackydln commented 1 year ago

Oh wait, it does but app crash is the problem but you only mean it to be used for debugging.

Using throwExceptions true makes my code cleaner, though.