In my case server is not available and so I can not read data for client and so I want to throw an Exception.
What Exception should I throw?
I don’t want to create my own exception class for such situation, because there are a lot of different situations in program.
Probably there are some kind of “general” exception, like “NetworkProblem” or even just “Problem” or something?
I don’t need anything specific, just an exception with message.
Sounds like an
IOExceptionto me. There may be a more explicit network-related exception, but I’m not sure.IOExceptionis at least a reasonable start…