Fix socket error & output the errors

Signed-off-by: Aleksi Sapon <QcTechs@gmail.com>