Skip to content
Tcl Source Code View Ticket
Login

View Ticket

catch {expr something} is spotty

Closed / Fixed577015ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-07-03 15:36:00
Version: 8.3.4
OS: Windows NT 4.0 SP 6 and Windows 2000

Problem:
When using expr within a catch statement, sometimes an 
error is still thrown. For example:

catch {expr NA}
-> Throws an error

catch {expr NA} cerr
-> Returns 1

catch {expr}
-> Throws an error

catch {expr} cerr
-> Returns 1

catch {expr this should work}
-> Returns 1

catch {expr 5/0}
-> Returns 1.

Expected behavior:
Should return 1 on any error condition.
dkf Ticket [577015ffff]: 1 change [History diff]2002-07-03 22:45:49
msoferplain2002-07-04 00:38:00
Logged In: YES 
user_id=148712

The [catch] compiler should never return TCL_ERROR, as this
prevents the error to be caught. It now returns
TCL_OUT_LINE_COMPILE instead, so that the error occurs at
runtime and can be caught.

Fixed in HEAD and tcl-core-8-3-1-branch.
Log in (anonymous is fine) to add a comment.