Catch server close errors