added printing error messages and connection error exception