debug socket exception handler