RGB.NET icon indicating copy to clipboard operation
RGB.NET copied to clipboard

set ThrowsExceptions false after initialization

Open Aytackydln opened this issue 2 years ago • 4 comments

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

Hopefully this is an acceptable solution.

Aytackydln avatar Sep 06 '23 18:09 Aytackydln

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.)

DarthAffe avatar Sep 06 '23 18:09 DarthAffe

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?

Aytackydln avatar Sep 06 '23 19:09 Aytackydln

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?

DarthAffe avatar Sep 06 '23 19:09 DarthAffe

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.

Aytackydln avatar Sep 06 '23 19:09 Aytackydln