fix: handling of socket errors