Artifacts Associated With Ticket 734402ffffffffff
Ticket change [c8bf48b73f] (rid 122158) by nobody on 2003-05-08 01:47:32:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
catch [ error "This is an error"] Fails to catch to error in tcl 8.4.2. In tcl 8.3, this correctly caught the error. For this simple case, the obvious fix is: catch { error "This is an error" } However, the difference in behavior affects more complex scripts. -John <[email protected]> - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "catch fails to catch error"
- type initialized to: "Bug"
Ticket change [6f624bd878] (rid 100308) by msofer on 2003-05-08 09:28:47:
- assignee changed to: "msofer"
- closedate changed to: "2003-05-08T02:28:47"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 The described 8.4.2 behaviour is correct: catch [ error "This is an error"] is semantically equivalent to set err [ error "This is an error"] catch $err as substitution occurs before the [catch] command is invoked; as substitution raises an error, [catch] is never actually invoked. Did this really catch the error in 8.3? Could you please post the output of info patchlevel in the corresponding interpreter?
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Pending"
- username: "msofer"
Ticket change [6fc01fb1f8] (rid 100366) by dgp on 2003-05-08 11:23:47:
- icomment:
Logged In: YES user_id=80530 See Bug 219184. Fixed for Tcl 8.4a3.
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "dgp"
- icomment:
Ticket change [de7ab19aaa] (rid 114856) by msofer on 2003-05-08 19:24:19:
- closedate changed to: "2003-05-08T12:24:19"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Doh ... I did have a déjà-vu feeling.
- login: "msofer"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "msofer"
Ticket change [5636689a5e] (rid 94281) by nobody on 2003-05-12 08:01:15:
- icomment:
Logged In: NO The behavior may be correct, but the man page for "catch" does not indicate any distinction between "catch [ error ]" and "catch { error }". I believe that, as a minimum, the documentation of "catch" should be corrected. - login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [3554c920b5] (rid 106904) by msofer on 2003-05-13 03:36:50:
- closedate changed to: "2003-05-12T20:36:50"
- closer changed to: "msofer"
- icomment:
Logged In: YES user_id=148712 Ah, but this distinction has nothing to do with the [catch] command - it is described in the Tcl man page Tcl.n, rule [2]: when you invoke catch [error] the error occurs during the substitution phase, *before* [catch] is called (as it is, it never gets called). Note also that the (buggy) behaviour in 8.3 was inconsistent: % info patch 8.3.4 % catch [error] 1 % set c catch; $c [error] wrong # args: should be "error message ?errorInfo? ?errorCode?"
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"