File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public function parseMethod($method) {
4747 return false ;
4848 }
4949
50- $ parts = explode ($ method , '. ' );
50+ $ parts = explode ('. ' , $ method );
5151 foreach ($ parts as $ part ) {
5252 // There cannot be empty part in route
5353 if (empty ($ part )) return false ;
@@ -137,13 +137,15 @@ public function executeRequest($request) {
137137 $ route = $ request ->route ;
138138 try {
139139 \Yii::trace ("Route requested: ' $ route' " , __METHOD__ );
140- $ this ->requestedRoute = $ route ;
140+ \Yii:: $ app ->requestedRoute = $ route ;
141141 $ result = \Yii::$ app ->runAction ($ request ->route , $ request ->params );
142142 return $ result ;
143143 }
144144 catch (\Exception $ exception ) {
145145 if ($ exception instanceof InvalidRouteException) {
146- return new Exception ('Method not found. ' , JSON_RPC_ERROR_METHOD_NOT_FOUND );
146+ $ result = new Exception ('Method not found. ' , JSON_RPC_ERROR_METHOD_NOT_FOUND );
147+ $ result ->data ['message ' ] = $ exception ->getMessage ();
148+ return $ result ;
147149 }
148150 else if ($ exception instanceof Exception) {
149151 return $ exception ;
You can’t perform that action at this time.
0 commit comments