change your network timeout settings to be what you want, then it wont take 9 minutes

put an exception clause in which handles the error and does something with it