handling error events of wsserver