Handles exceptions when there is no internet connection