Catching an exception for when there is no window associated with a request