handle socket errors gracefully to help users debug usecases