comparison mod_admin_web/admin_web/www_files/js/main.js @ 915:1d03dc7cf28f

mod_admin_web: Better error reporting
author Florian Zeitz <florob@babelmonkeys.de>
date Tue, 19 Feb 2013 23:53:50 +0100
parents fa996cfec6da
children 7cba8be42d9e
comparison
equal deleted inserted replaced
914:fa996cfec6da 915:1d03dc7cf28f
94 94
95 function onConnect(status) { 95 function onConnect(status) {
96 if (status == Strophe.Status.CONNECTING) { 96 if (status == Strophe.Status.CONNECTING) {
97 log('Strophe is connecting.'); 97 log('Strophe is connecting.');
98 } else if (status == Strophe.Status.CONNFAIL) { 98 } else if (status == Strophe.Status.CONNFAIL) {
99 alert('Connection failed (Wrong host?)');
99 log('Strophe failed to connect.'); 100 log('Strophe failed to connect.');
100 showConnect(); 101 showConnect();
101 } else if (status == Strophe.Status.DISCONNECTING) { 102 } else if (status == Strophe.Status.DISCONNECTING) {
102 log('Strophe is disconnecting.'); 103 log('Strophe is disconnecting.');
103 } else if (status == Strophe.Status.DISCONNECTED) { 104 } else if (status == Strophe.Status.DISCONNECTED) {
104 log('Strophe is disconnected.'); 105 log('Strophe is disconnected.');
105 showConnect(); 106 showConnect();
106 } else if (status == Strophe.Status.AUTHFAIL) { 107 } else if (status == Strophe.Status.AUTHFAIL) {
108 alert('Wrong username and/or password');
107 log('Authentication failed'); 109 log('Authentication failed');
108 if (connection) { 110 if (connection) {
109 connection.disconnect(); 111 connection.disconnect();
110 } 112 }
111 } else if (status == Strophe.Status.CONNECTED) { 113 } else if (status == Strophe.Status.CONNECTED) {