use basic error instead of nil as default for socket error

closes #450