Skip to content
Tcl Source Code History Of Ticket 431992ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 431992ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 431992ffffffffffffffffffffffffffffffffff

  1. Ticket change [44c3143e94] (rid 116760) by mgbacke on 2001-06-11 06:07:17:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
    4. foundin initialized to: "obsolete: 8.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "mgbacke"
    9. subsystem initialized to: "29. http Package"
    10. title initialized to: "-command doesn't propagate errors"
    11. type initialized to: "Bug"
  2. Ticket change [f2005da990] (rid 109455) by dkf on 2001-06-11 15:30:38:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      (adjusted summary/title for greater clarity in bug-list)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. title changed to: "http::geturl -command doesn't propagate errors"
    5. username: "dkf"
  3. Ticket change [143c989998] (rid 124354) by andreas_kupries on 2001-08-01 04:35:21:

    1. assignee changed to: "hobbs"
  4. Ticket change [5ed393babf] (rid 115698) by hobbs on 2001-08-07 06:15:50:

    1. assignee changed to: "welch"
  5. Ticket change [e4cdb1740c] (rid 88022) by welch on 2001-08-15 06:15:20:

    1. 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?
      
      
    2. login: "welch"
    3. mimetype: "text/plain"
    4. username: "welch"
  6. Ticket change [3696f79f76] (rid 107129) by hobbs on 2001-08-21 06:52:57:

    1. closedate changed to: "2001-08-20T23:52:57"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      Closing this based on Brent's response (and no other follow-
      up).
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "hobbs"
  7. Ticket change [218259e995] (rid 130596) by mgbacke on 2001-08-21 12:10:56:

    1. closedate changed to: "2001-08-21T05:10:56"
    2. closer changed to: "mgbacke"
    3. 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
      
      
    4. login: "mgbacke"
    5. mimetype: "text/plain"
    6. username: "mgbacke"
  8. Ticket change [685d1203db] (rid 103052) by nobody on 2001-08-21 20:37:53:

    1. 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
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  9. Ticket change [d85b08ae08] (rid 107419) by mgbacke on 2001-09-03 01:56:18:

    1. closedate changed to: "2001-09-02T18:56:18"
    2. closer changed to: "mgbacke"
    3. 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.
      
      
    4. login: "mgbacke"
    5. mimetype: "text/plain"
    6. username: "mgbacke"