Catch exceptions
authorEnrico Zini <enrico@enricozini.org>
Sun, 29 Nov 2009 17:38:39 +0000 (18:38 +0100)
committerEnrico Zini <enrico@enricozini.org>
Sun, 29 Nov 2009 17:38:39 +0000 (18:38 +0100)
src/app_power.vala

index 496a642b5aa0f262031a6719b2e39175c67056c7..eaf689c027bc2a0c33af4277b981cf44bbbe0c91 100644 (file)
@@ -96,7 +96,6 @@ public class Power : zavai.Resource, Object
                }
                if (!done)
                {
                }
                if (!done)
                {
-                       zavai.app.run_script("pm-suspend");
                        /*
                        // From http://lindi.iki.fi/lindi/openmoko/susp
                        try {
                        /*
                        // From http://lindi.iki.fi/lindi/openmoko/susp
                        try {
@@ -124,8 +123,13 @@ public class Power : zavai.Resource, Object
                                zavai.log.error("Cannot tell GSM to resume (but never mind): " + e.message);
                        }
                        */
                                zavai.log.error("Cannot tell GSM to resume (but never mind): " + e.message);
                        }
                        */
-                       done = true;
-                       zavai.log.info("Suspend was done with zavai.");
+                       try {
+                               zavai.app.run_script("pm-suspend");
+                               done = true;
+                               zavai.log.info("Suspend was done with zavai.");
+                       } catch (Error e) {
+                               zavai.log.error("Suspending phone: " + e.message);
+                       }
                }
        }
        public void do_shutdown()
                }
        }
        public void do_shutdown()