jojo
jojo

Reputation: 13843

How can i know what kind of exception a class will throw?

is there any page from MSDN or somewhere can tell us, what kind of exception will be throw from a specific class?

for example, FtpWebRequest. how can i find out what kind of exception it will throw?? the page from MSDN is not really helpful http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest%28v=VS.100%29.aspx

Thanks

Upvotes: 1

Views: 217

Answers (2)

AngryHacker
AngryHacker

Reputation: 61606

As others said, the intellisense will tell you. In addition, you could step into the framework code itself.

In addition, the documentation for each method contains the list of exceptions it might throw. Example.

Upvotes: 1

OJ.
OJ.

Reputation: 29401

Classes don't throw exceptions. Members (Properties and Methods) do. So you need to look at the documentation for the individual members to know.

Upvotes: 3

Related Questions