Mercurial > xmpp-account-manager
diff vcard.js @ 30:9ba4f8cc32f1
Display the returned error in the title of the spinner.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 23 Dec 2018 17:15:38 +0100 |
parents | 02b5bceeca64 |
children | e561bdd81777 |
line wrap: on
line diff
--- a/vcard.js +++ b/vcard.js @@ -61,7 +61,7 @@ function initVCard(connection) { if (vcard_bday.value) iq.c('bday') .c('date').t(vcard_bday.value).up().up(); - connection.sendIQ(iq, onVCard4Changed, onVCard4ChangeError.bind(null, 'coucou')); + connection.sendIQ(iq, onVCard4Changed, onVCard4ChangeError); displaySpinner(spinner_img); } @@ -75,10 +75,12 @@ function initVCard(connection) { spinnerOk(spinner_img); } - function onVCard4ChangeError(string) + function onVCard4ChangeError(iq) { - console.log('Failed to set vCard4: ' + string); - spinnerError(spinner_img); + const [condition, text] = parseErrorIq(iq); + const string = 'Failed to set vCard4: ' + condition + ': ' + text; + console.log(string); + spinnerError(spinner_img, string); } vcard_access.addEventListener('change', function (evt) {