Use
catch(FaultException<ArgumentException> exception) { }
General syntax always works; you only should understand that the type is always some instantiated type
FaultException<ArgumentException>
. As to
FaultException
, this is not exactly a type, this is a generic type, not instantiated.
[EDIT]
"It did not work" is not a valid issue report. I just gave you a valid way to catch an exception of a certain type, which always work. Any useful advice can work if you understand where to use it, not that you catch something-which-should-not-be-named in a catch block who-knows-there, as you can experience endless problems without really understanding what's going on. You should always run your code under debugger in the settings where you can get all the information you need.
To start with, you can catch
all exceptions on
top of the stack of each thread and, say, put a break point on every handler. When exception is caught, you should examine its exact type. Importantly, you need to look at
Exception.Stack
: this is just a string; and, if debug information was available during the run, if will show you all the file names and line numbers where the exception was thrown/propagated to the point you are stopped in. Looking this information, you can untie the whole history of what happened.
—SA