Update listener name, login_success -> ['login, 'success']
Catch error in writeRaw() and close socket
Add missing semicolon
Log received error from MC, catching 'error' event so it doesn't throw