If you write an API that other developers will use - better take the second approach, it's easier (and cleaner) to handle from the "customer" side:
while (!disconnected()) {
// do something else
// sleep and try again
// etc
}
In general - don't throw exceptions that you know how to handle gracefully!