Artifacts Associated With Ticket 1414262fffffffffffffffffffffffffffffffff
Ticket change [ddd1ee1479] (rid 114744) by setok on 2006-01-25 03:43:41:
- assignee initialized to: "hobbs"
- cmimetype initialized to: "text/plain"
- comment initialized to:
If any kind of error occurs in the script passed as a parameter to - command, it just vanishes and is not passed to bgerror or to anything else. All kinds of errors are caught, including syntax errors, making debugging a chore at best and resulting in "why did nothing happen?" ponderings. A minimal script is attached that demonstrates this.
- foundin initialized to: "obsolete: 8.4.12"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "setok"
- subsystem initialized to: "29. http Package"
- title initialized to: "Errors in -command script not reported"
- type initialized to: "Bug"
Add attachment "httptest.tcl" [3166c675bb] (rid 93420) by setok on 2006-01-25 10:43:42.
Ticket change [9c57ad1352] (rid 96135) by setok on 2006-01-25 10:43:42:
- icomment:
File Added - 164800: httptest.tcl
- login: "setok"
- mimetype: "text/plain"
- username: "setok"
- icomment:
Ticket change [f2ac5875fc] (rid 109593) by dkf on 2006-01-25 16:13:38:
- icomment:
Logged In: YES user_id=79902 Not quite. The error gets logged in the state array where you can retrieve it with [http::error] (and the [http::status] is error). But the error only gets logged if the callback wasn't called to deal with an error in the first place; if it was dealing with an error condition, the callback failure gets dropped in a bit-bucket. I'm not at all sure what the right thing to do is, and nor am I sure what the compatible thing to do is. :-)
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "7 High"
- username: "dkf"
- icomment:
Ticket change [7ff2725c7e] (rid 97650) by setok on 2006-01-26 02:49:22:
- icomment:
Logged In: YES user_id=137542 But this mechanism is not sufficient. The whole point of using the -command procedure is to provide asynchronous operation. If the callback script caused an error then perhaps http::error will give us that error, but we have no way of knowing when to look at it, without polling or by some magic mechanism at the beginning of the -command. We should have to do this kind of work just to catch script errors. I cannot see why the -command operation cannot use the same mechanism as all other callbacks and find errors reported to bgerror.
- login: "setok"
- mimetype: "text/plain"
- username: "setok"
- icomment:
Ticket change [90fc319ac3] (rid 120553) by dkf on 2006-01-26 04:32:16:
- icomment:
Logged In: YES user_id=79902 That's in large part what I was talking about in relation to "right thing" and "compatible thing". :-)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [6471ca0ee6] (rid 92773) by ferrieux on 2008-04-06 05:22:36:
- icomment:
Logged In: YES user_id=496139 Originator: NO Sorry to dig that one so late :-) I understand that http does this because [bgerror] is not modular, and no package can hijack it from the application. So currently it takes pains never to leave an exception reach the surface. What about adding a [configure -error] callback for this purpose ? This would somewhat solve setok's concern about polling.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [12a4c00494] (rid 124074) by kjnash on 2012-10-30 10:48:53:
- icomment:
Yes, this is probably the worst "gotcha" with http. If nothing else is done about it, a prominent warning should be added to the man page. My own workaround is that my -command script has a [catch] of its own, and if an error is detected, it calls the bgerror handler directly. The Tk bgerror is a modal dialog that uses vwait to enter the event loop. The reason the authors of the http package avoid raising an error might be that they did not want to use vwait. P.S. Also reported as bug 2937318.
- login: "kjnash"
- mimetype: "text/plain"
- username: "kjnash"
- icomment:
Ticket change [520d29f387] (rid 137375) by anonymous on 2014-03-24 22:20:11:
- assignee changed to: "aku"
- closer changed to: "nobody"
- comment changed to:
If any kind of error occurs in the script passed as a parameter to - command, it just vanishes and is not passed to bgerror or to anything else. All kinds of errors are caught, including syntax errors, making debugging a chore at best and resulting in "why did nothing happen?" ponderings. A minimal script is attached that demonstrates this.
- icomment:
-command is a callback; any error that occurs in it belongs to the user, and should be bubbled up to the top so that it can get caught and *fixed*. That's standard behavior; I don't see why http is special.
- login: "anonymous"
- mimetype: "text/plain"
- severity changed to: "Minor"
- username: "whd"
Ticket change [480b44514e] (rid 137699) by dkf on 2014-04-21 06:02:12:
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "8"
- severity changed to: "Important"
Ticket change [dd8750c479] (rid 200598) by kjnash on 2022-05-12 01:38:23:
- icomment:
There is no agreement on the "right thing" or the "compatible thing", so I have documented what http does in its man page. The problem confused me the first time I ran into it, but 90% of my confusion was because it was undocumented and therefore unexpected. Documentation http(n) changed for each callback that is executed inside a catch. Longer description in section "ERRORS". See commit [277e9c6ba6d232bc].
- login: "kjnash"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [96d253ee52] (rid 200613) by kjnash on 2022-05-13 02:59:15:
- login: "kjnash"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Pending"
Ticket change [288fc33a57] (rid 201355) by kjnash on 2022-05-30 16:24:20:
- closedate changed to: "2459730.18356834"
- closer changed to: "kjnash"
- login: "kjnash"
- mimetype: "text/plain"
- status changed to: "Closed"