Dragan
Dragan

Reputation: 3743

What kind of exception is 'Connection Timed Out' - ASP.NET

I'm working on an asp.net application which communicates with web services. However quite often of late, the services have been down. I don't want to throw a generic Exception but rather a very specific one. What is the Exception name that handles 'connection timed out'. Thank you!

Upvotes: 1

Views: 870

Answers (1)

Oskar Kjellin
Oskar Kjellin

Reputation: 21880

The correct one to throw is TimeoutException. The default message is The operation has timed-out

From MSDN:

The exception that is thrown when the time allotted for a process or operation has expired.

Upvotes: 3

Related Questions