Author: jerome
Date: 2009-10-28 13:38:30 +0100 (Wed, 28 Oct 2009)
New Revision: 5779

Modified:
   
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
   
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java
Log:
* Facebook error string improvement.

Modified: 
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
===================================================================
--- 
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
   2009-10-28 12:14:00 UTC (rev 5778)
+++ 
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
   2009-10-28 12:38:30 UTC (rev 5779)
@@ -27,6 +27,7 @@
 import com.google.code.facebookapi.FacebookException;
 import com.google.code.facebookapi.FacebookJsonRestClient;
 import com.kysoh.plugins.facebook.connection.BareBonesBrowserLaunch;
+import com.kysoh.plugins.facebook.connection.FacebookLoginException;
 import com.kysoh.plugins.facebook.connection.FacebookSessionUtils;
 
 public class FacebookConnection {
@@ -74,7 +75,7 @@
        
        
        
-       public boolean Connect(String username, String password)
+       public boolean Connect(String username, String password) throws 
FacebookLoginException
        {
                FacebookSessionUtils.setMail(username);
                FacebookSessionUtils.setPass(password);
@@ -110,7 +111,10 @@
                } 
                catch (FacebookException e) 
                {
-                       //e.printStackTrace();
+                       if(e.getMessage().equalsIgnoreCase("invalid parameter"))
+                       {
+                               throw new FacebookLoginException();
+                       }
                } 
                catch (IOException e) 
                {

Modified: 
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java
===================================================================
--- 
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java
       2009-10-28 12:14:00 UTC (rev 5778)
+++ 
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java
       2009-10-28 12:38:30 UTC (rev 5779)
@@ -28,6 +28,7 @@
 import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePlugin;
 import com.kysoh.plugins.facebook.configuration.FacebookDatasStruct;
 import com.kysoh.plugins.facebook.configuration.PluginFacebookConfiguration;
+import com.kysoh.plugins.facebook.connection.FacebookLoginException;
 import com.kysoh.plugins.facebook.connection.FacebookPromptException;
 import com.kysoh.plugins.facebook.FacebookConnection;
 
@@ -97,8 +98,20 @@
        {
                FacebookConnection facebook = new FacebookConnection();
                
-               if ( facebook.Connect(this.configuration().getLogin(), 
this.configuration().getPassword()) )
+               boolean connected = false;
+               
+               try 
                {
+                       connected = 
facebook.Connect(this.configuration().getLogin(), 
this.configuration().getPassword());
+               } 
+               catch (FacebookLoginException e) 
+               {
+                       this.throwMessage("You do not seem to be connected. 
Please, verify you username and password, then try again.");
+                       System.exit( 0 );
+               }
+               
+               if ( connected )
+               {
                        //Facebook global functions object.
                        functions = new FacebookFunctions(facebook.getClient());
                        


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to