DomAPI Home
DomAPI
Build: 4.0 BETA
Topic: RPC ... server-side errors

  casad registered v3 wrote on Tuesday 12/2/03 at 6:37 AM (PST)  
 

I have been messing around with the RPC object and find it to be a pretty nice feature. The only thing is when I have an syntax error in the server-side script (PHP). It doesn't allow me to look at the error because the RPC object is expecting ONLY the specific RPCPacket response. Therefore the browser will either just sit there and not do anything or return a javascript error because the return PHP error is being placed inside the script tags. This is no big deal if you have a fairly small script on the server that you can easily test on its own but if you have a complex script with a large number of parameters being passed to it you may not be able to account for all possible problems/errors you may encounter.

Have others run into this situation? If so, what is your solution?

Just thinking out loud ... I'm wondering if the RPC object could tell if what is being returned is not what it expects then simply have it spit out whatever the server-side script returned (ie. error statements). Maybe have the RPC object check the response for "var response = new RPCPacket();" and if it isn't the first line in the response then send the response to a popup window??

Any thoughts?

It's definitely a cool object!

--Chris

 
    RSS feed of forum  
  M.vd Dobbelsteen registered v3 wrote on Tuesday 12/2/03 at 7:19 AM (PST)  
 

Had the same problem.
Changed the following line of _dispatch methode in rpc_core:

if(this.doDebug){alert("Dispatching: "+url);window.open(url,null,"status=yes,toolbar=yes,",null);}

In debugmode it will open an additional window to watch the server
responses.

Succes!

Ciao,
Marc

 
    RSS feed of forum  
  casad registered v3 wrote on Tuesday 12/2/03 at 7:39 AM (PST)  
 

Marc,

That's what I was looking for ... it works! Thank you.

Darin ... do you think this may be something worth tossing in a future build?

--Chris

 
    RSS feed of forum  
  Darin Kadrioski registered v4 wrote on Tuesday 12/2/03 at 7:47 AM (PST)  
 

Just did ;)

thanks!
Darin Kadrioski Darin Kadrioski
support@domapi.com

 
    RSS feed of forum  
You could respond to this post if you were logged in.
DHTML by www.domapi.com