|
-
Nov 8th, 2013, 12:10 PM
#6
Thread Starter
Fanatic Member
Re: Suppressing workflow exceptions from being logged
I agree, for that reason I often try to avoid empty catches as much as possible. Often times though, you need a way to 'quickly' abort a certain operation, for example when a form closes or is closed. With multithreading this tends to become an issue, as it is still in the middle of interacting with an object it just found out got disposed.
Often times this sort of thing can not be prevented: there is no control event fired right before disposing. At that time the only way to put everything to a halt is to catch the exception thrown when invoke is executed...but this results in your console ending up full of errors.
Yeah, these are the kind of exceptions that should not be workflow exceptions, but become them because that is pretty much their only purpose. And you don't want your program crash randomly because you forgot to try-catch an invoke instruction.
Like I mentioned, I started using the 'wait object', which @dbasnett posted as well. For my problem mentioned in the OP this is indeed the best way to go around it. I do wonder what the purpose of that Thread.interrupt() even is, if it can't be used for aborting a thread. Marked as resolved.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|