# HG changeset patch # User Nikita Kozlov # Date 1266087282 -3600 # Node ID baaee1877b2bee527d67cd2fc731cb18a8344cb3 # Parent f0ee4f04b3acd827963fbd865f53b9a4c17ba271 add more explicit error message during login diff -r f0ee4f04b3ac -r baaee1877b2b .classpath --- a/.classpath Sat Feb 13 15:55:49 2010 +0100 +++ b/.classpath Sat Feb 13 19:54:42 2010 +0100 @@ -1,7 +1,7 @@ - + diff -r f0ee4f04b3ac -r baaee1877b2b default.properties --- a/default.properties Sat Feb 13 15:55:49 2010 +0100 +++ b/default.properties Sat Feb 13 19:54:42 2010 +0100 @@ -10,5 +10,5 @@ # Indicates whether an apk should be generated for each density. split.density=false # Project target. -target=android-4 +target=android-7 apk-configurations= diff -r f0ee4f04b3ac -r baaee1877b2b res/values-fr/strings.xml --- a/res/values-fr/strings.xml Sat Feb 13 15:55:49 2010 +0100 +++ b/res/values-fr/strings.xml Sat Feb 13 19:54:42 2010 +0100 @@ -302,4 +302,33 @@ Non Mettre à jour + + + + Erreur lors de l\'authenfitication, mauvais login ou password + + Erreur survenu sur le serveur + bad-request + forbidden + item-not-found + conflict + feature-not-implemented + gone + jid-malformed + no-acceptable + not-allowed + not-authorized + payment-required + recipient-unavailable + redirect + registration-required + Serveur non trouvé + Pas de réponse du serveur + Erreur survenu sur le serveur + resource-constraint + service-unavailable + subscription-required + undefined-condition + unexpected-condition + request-timeout diff -r f0ee4f04b3ac -r baaee1877b2b res/values/strings.xml --- a/res/values/strings.xml Sat Feb 13 15:55:49 2010 +0100 +++ b/res/values/strings.xml Sat Feb 13 19:54:42 2010 +0100 @@ -286,4 +286,33 @@ No Update + + + + Error during authentication, bad login or password. + + Remote server error + bad-request + forbidden + item-not-found + conflict + feature-not-implemented + gone + jid-malformed + no-acceptable + not-allowed + not-authorized + payment-required + recipient-unavailable + redirect + registration-required + Remote server not found + No server response + Remote server error + resource-constraint + service-unavailable + subscription-required + undefined-condition + unexpected-condition + request-timeout diff -r f0ee4f04b3ac -r baaee1877b2b src/com/beem/project/beem/service/XmppConnectionAdapter.java --- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Sat Feb 13 15:55:49 2010 +0100 +++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Sat Feb 13 19:54:42 2010 +0100 @@ -40,7 +40,7 @@ Flavien Astraud, November 26, 2009 Head of the EIP Laboratory. -*/ + */ package com.beem.project.beem.service; import org.jivesoftware.smack.ConnectionConfiguration; @@ -171,10 +171,17 @@ return true; } catch (XMPPException e) { Log.e(TAG, "Error while connecting", e); - if (!"".equals(e.getMessage())) - mErrorMsg = e.getMessage(); - else - mErrorMsg = e.toString(); + try { + String str = mService.getResources().getString( + mService.getResources().getIdentifier( + e.getXMPPError().getCondition().replace("-", "_"), "string", "com.beem.project.beem")); + mErrorMsg = str; + } catch(NullPointerException e2) { + if (!"".equals(e.getMessage())) + mErrorMsg = e.getMessage(); + else + mErrorMsg = e.toString(); + } } return false; } @@ -211,15 +218,12 @@ mService.resetStatus(); mService.initJingle(mAdaptee); - // triggerAsynchronousConnectEvent(); + // triggerAsynchronousConnectEvent(); changeStatus(Status.CONTACT_STATUS_AVAILABLE, mService.getServicePreference().getString("status_text", "")); return true; } catch (XMPPException e) { Log.e(TAG, "Error while connecting", e); - if (!"".equals(e.getMessage())) - mErrorMsg = e.getMessage(); - else - mErrorMsg = e.toString(); + mErrorMsg = mService.getString(R.string.error_login_authentication); return false; } }