Re: Trapping Errors ..Mac to do server stuff...
Thanks for this David, I'll give it a go. The reason I don't debug first and then run through a browser may also be relevant to your other post "Subject: anyone know how to get a Mac to do server stuff offline?" I'm running two browsers, an HTTP server (WebTen on port 80) and a Metacard CGI server (on port 81) all on the same standalone Mac (G4 192Mb) . Pages are served from WebTen with cgi requests going to port 81 and Metacard creating custom HTML responses on the fly. The build involves the simultaneous creation of HTML forms (with Javascript processing) and the corresponding MC cgi processing and responses. All quite chaotic but good fun, and also a VERY quick build ! As I don't have DNS on my machine all calls are put through my (self allocated) IP number followed by a port ref eg http://192.123.92.12:8181 For the actual project the processes will be split across numerous Mac's with the only alteration being a change in the IP numbers... I know you said 'offlist' but the Mac and Metacard are a killer combo and the world needs to know !!! on 14/9/00 7:13 pm, David Bovill at [EMAIL PROTECTED] wrote: Not quite sure why you don't debug first without running through a browser, but --snip-- Its all Mac based and I'm using MC as an HTTP server with additional code to process forms. It works a treat... until I make a mistake like a typo... If I type : on mouseUp put "thtml" ito "pageout" end mouseUp into the button script of any stack, its accepted ie no semantic error. When I click on the button however an error "Cant find handler" along with line number and other error info is presented in the Execution Error dialog box. Great - enough info to locate and fix the problem. Now if the above routine is called by a browser through a socket connection to an MC stack then MC doesn't present the same Execution Error box and the only clue that something is wrong is that nothing is returned to the browser. Hence manually searching through the code. Any ideas ? It should be possible to build in a debugger that works with the server, but figuring out how to do this/how the existing debugger works is not easy, and according to Scott is likely to be a moving target... An idea (if you have to debug online), is to put the cgi script into a variable and then have a go at something like repeat with lineNum = 1 to the number of lines of cgiScript put line lineNum of cgiScript into scriptLine try do scriptLine catch errorNum put "Error" errorNum "on line" lineNum end try end repeat It'll be slow, but might work? --snip-- Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Trapping Errors ..Mac to do server stuff...
Could you let us know how you configure the G4 TCP/IP so the browser and servers connect? I have a Java based server which listens and replies on Port 2001. I want to get Metacard and/or a browser to talk to this server. When the server loads it indicates that there is an open transport error, which I presume is due to a lack of an active TCP/IP connection. Perhaps if I knew exactly how to do this with MCHTTP and a browser offline, I could work from there... From: Gary Rathbone [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Thu, 14 Sep 2000 21:24:04 +0100 To: [EMAIL PROTECTED] Subject: Re: Trapping Errors ..Mac to do server stuff... Thanks for this David, I'll give it a go. The reason I don't debug first and then run through a browser may also be relevant to your other post "Subject: anyone know how to get a Mac to do server stuff offline?" I'm running two browsers, an HTTP server (WebTen on port 80) and a Metacard CGI server (on port 81) all on the same standalone Mac (G4 192Mb) . Pages are served from WebTen with cgi requests going to port 81 and Metacard creating custom HTML responses on the fly. The build involves the simultaneous creation of HTML forms (with Javascript processing) and the corresponding MC cgi processing and responses. All quite chaotic but good fun, and also a VERY quick build ! As I don't have DNS on my machine all calls are put through my (self allocated) IP number followed by a port ref eg http://192.123.92.12:8181 For the actual project the processes will be split across numerous Mac's with the only alteration being a change in the IP numbers... I know you said 'offlist' but the Mac and Metacard are a killer combo and the world needs to know !!! on 14/9/00 7:13 pm, David Bovill at [EMAIL PROTECTED] wrote: Not quite sure why you don't debug first without running through a browser, but --snip-- Its all Mac based and I'm using MC as an HTTP server with additional code to process forms. It works a treat... until I make a mistake like a typo... If I type : on mouseUp put "thtml" ito "pageout" end mouseUp into the button script of any stack, its accepted ie no semantic error. When I click on the button however an error "Cant find handler" along with line number and other error info is presented in the Execution Error dialog box. Great - enough info to locate and fix the problem. Now if the above routine is called by a browser through a socket connection to an MC stack then MC doesn't present the same Execution Error box and the only clue that something is wrong is that nothing is returned to the browser. Hence manually searching through the code. Any ideas ? It should be possible to build in a debugger that works with the server, but figuring out how to do this/how the existing debugger works is not easy, and according to Scott is likely to be a moving target... An idea (if you have to debug online), is to put the cgi script into a variable and then have a go at something like repeat with lineNum = 1 to the number of lines of cgiScript put line lineNum of cgiScript into scriptLine try do scriptLine catch errorNum put "Error" errorNum "on line" lineNum end try end repeat It'll be slow, but might work? --snip-- Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Trapping Errors ..Mac to
Could you let us know how you configure the G4 TCP/IP so the browser and servers connect? I have a Java based server which listens and replies on Port 2001. I want to get Metacard and/or a browser to talk to this server. When the server loads it indicates that there is an open transport error, which I presume is due to a lack of an active TCP/IP connection Perhaps if I knew exactly how to do this with MCHTTP and a browser offline, I could work from there... If you read my previous post on TCP/IP and your server still not working maybe it's Java. Get my web server from cloud9.net/~undo, set your tcp/ip like I explained and the server works. Don't forget to set the port. Regards, Andu ___ [EMAIL PROTECTED] Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Trapping Errors ..Mac to
Thanks for the earlier post Andu. I think the problem is Mac OS 8.6 on my other Mac - the iMac with 9.0 is OK, but does not have enough memory (and the iMac system disks won't work on it). I'll try seeing if I can get an open transport software update which is downloadable, otherwise maybe I'll get round to installing Linux on the thing. From: andu [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Thu, 14 Sep 2000 18:53:20 -0400 (EDT) To: [EMAIL PROTECTED] Subject: Re: Trapping Errors ..Mac to Could you let us know how you configure the G4 TCP/IP so the browser and servers connect? I have a Java based server which listens and replies on Port 2001. I want to get Metacard and/or a browser to talk to this server. When the server loads it indicates that there is an open transport error, which I presume is due to a lack of an active TCP/IP connection Perhaps if I knew exactly how to do this with MCHTTP and a browser offline, I could work from there... If you read my previous post on TCP/IP and your server still not working maybe it's Java. Get my web server from cloud9.net/~undo, set your tcp/ip like I explained and the server works. Don't forget to set the port. Regards, Andu ___ [EMAIL PROTECTED] Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard%40lists.best.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.