[Sungrazr-svn] [105] Sungrazr_Server_Adapter_JsonRpc: [CHG] Check for a fault condition after creating the handler object, before calling the handler method.

0 views
Skip to first unread message

cl...@killersoft.com

unread,
Dec 21, 2007, 9:31:54 PM12/21/07
to Sungra...@googlegroups.com
Revision
105
Author
clay
Date
2007-12-21 18:31:53 -0800 (Fri, 21 Dec 2007)

Log Message

Sungrazr_Server_Adapter_JsonRpc: [CHG] Check for a fault condition after creating the handler object, before calling the handler method.

Modified Paths

Diff

Modified: trunk/Sungrazr/Server/Adapter/JsonRpc.php (104 => 105)


--- trunk/Sungrazr/Server/Adapter/JsonRpc.php	2007-12-21 01:31:07 UTC (rev 104)
+++ trunk/Sungrazr/Server/Adapter/JsonRpc.php	2007-12-22 02:31:53 UTC (rev 105)
@@ -142,12 +142,24 @@
                 'caller' => $this
             )
         );
+        
+        // should we return a fault immediately? 
+        // Construction/setup could have failed.
+        if ($obj->isFault === true) {
+            $fault = $obj->getFault();
+            return $this->fault(
+                $fault['message'],
+                $fault['code']
+            );
+        }
+        
+        // No fault during setup, so call the method
         $this->result = call_user_func_array(
             array($obj, $callback[1]),
             $this->params
         );
         
-        // should we return a fault?
+        // should we return a fault now?
         if ($obj->isFault === true) {
             $fault = $obj->getFault();
             return $this->fault(
Reply all
Reply to author
Forward
0 new messages