Change how socket errors are thrown