Artifacts Associated With Ticket 431992ffffffffff
Ticket change [44c3143e94] (rid 116760) by mgbacke on 2001-06-11 06:07:17:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
http 2.3 When using the -command option with http::geturl, any errors in the procedure specified by the argument to -command are caught (via catch) and not propagated to the users program. Although not catastrophic, catching user bugs becomes very difficult because errors are caught. If the procedure is responsible for calling http::geturl, the program will enter the event loop never to return. The pertinent code is in http::Finish. Any user program errors are caught, and the error message is saved in variable err, however, it's never used (apparently). It's not clear to me (not having written this package) why the state(error) & state(status) variables are set when the user procedure might never be called (if the procedure specified by -command is responsible for calling http::geturl). I could research this further and perhaps offer a solution, but it would hopefully be quicker if the person who wrote this code is still involved in its maintenance, and can offer a solution.
- foundin initialized to: "obsolete: 8.3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "mgbacke"
- subsystem initialized to: "29. http Package"
- title initialized to: "-command doesn't propagate errors"
- type initialized to: "Bug"
Ticket change [f2005da990] (rid 109455) by dkf on 2001-06-11 15:30:38:
- icomment:
Logged In: YES user_id=79902 (adjusted summary/title for greater clarity in bug-list)
- login: "dkf"
- mimetype: "text/plain"
- title changed to: "http::geturl -command doesn't propagate errors"
- username: "dkf"
- icomment:
Ticket change [143c989998] (rid 124354) by andreas_kupries on 2001-08-01 04:35:21:
- assignee changed to: "hobbs"
Ticket change [5ed393babf] (rid 115698) by hobbs on 2001-08-07 06:15:50:
- assignee changed to: "welch"
Ticket change [e4cdb1740c] (rid 88022) by welch on 2001-08-15 06:15:20:
- icomment:
Logged In: YES user_id=89720 The following fragments shows how you can find out if errors occurred. Is this not sufficient? package require http 2.3 proc badcommand {args} { error foo } set t [http::geturl http://www-internal.panasas.com/index.html -command badcommand] http::wait $t puts "status [http::status $t]" puts "error [http::error $t]" This generates: status error error foo {foo while executing "error foo" (procedure "badcommand" line 2) invoked from within "badcommand $token" ("eval" body line 1) invoked from within "eval $state(-command) {$token}"} NONE If we were really clever we could tweak the errorInfo so it would more clearly show that it was the -command callback. But, the error information is preserved in this case. Perhaps there is another usage case that you are thinking of? - login: "welch"
- mimetype: "text/plain"
- username: "welch"
- icomment:
Ticket change [3696f79f76] (rid 107129) by hobbs on 2001-08-21 06:52:57:
- closedate changed to: "2001-08-20T23:52:57"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 Closing this based on Brent's response (and no other follow- up).
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "hobbs"
Ticket change [218259e995] (rid 130596) by mgbacke on 2001-08-21 12:10:56:
- closedate changed to: "2001-08-21T05:10:56"
- closer changed to: "mgbacke"
- icomment:
Logged In: YES user_id=150456 Thanks for the suggested work-around. I see this has been closed (it has only been 6 days since Brent's follow-up - I'll try and be faster next time ;-) I agree that http::wait does work as you suggest. In my application where this 'bug' came to light, I was not using http:wait since it blocks the application (I'm using vwait and doing other things while data's being collected). This 'bug' is only an issue during program development. I am on the fence whether it is a bug or not. If a program can't make use of http::wait, then my original comments are still valid, yes? This just might be a case of "that's life". For myself, I can just modify ::http to get me through the debug cycle, and I can live with that. Perhaps if nothing else, a caveat could be added to the documentation stating the pitfalls of not using http::wait (in terms of getting access to errors associated with - command. Thanks for the insight regarding using http::wait. Marty
- login: "mgbacke"
- mimetype: "text/plain"
- username: "mgbacke"
Ticket change [685d1203db] (rid 103052) by nobody on 2001-08-21 20:37:53:
- icomment:
Logged In: NO [http::wait] is implemented in terms of [vwait] so I don't understand the distinction being made about their blocking behavior. Also, [http::wait] isn't doing any magic regarding [http::status] and [http::error]. They are updated by the events set in motion by [http::geturl] whether you wait for those events with [http::wait] or with [vwait]. What are you [vwait]-ing on? DGP
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [d85b08ae08] (rid 107419) by mgbacke on 2001-09-03 01:56:18:
- closedate changed to: "2001-09-02T18:56:18"
- closer changed to: "mgbacke"
- icomment:
Logged In: YES user_id=150456 Thanks for the followup Don. After looking at how http::wait is implemented and revisiting what Brent wrote, I see the errors in my ways. I wouldn't have had my problems if I had used http::wait (instead of vwait) as Brent demonstrates.
- login: "mgbacke"
- mimetype: "text/plain"
- username: "mgbacke"