Index: library/nx/nx.tcl =================================================================== diff -u -r361fa327cab70ec1c7bf085054bb96b649ed266c -r6b570a0b4a22c8cc62e30454b8ca7610d1b4bc6c --- library/nx/nx.tcl (.../nx.tcl) (revision 361fa327cab70ec1c7bf085054bb96b649ed266c) +++ library/nx/nx.tcl (.../nx.tcl) (revision 6b570a0b4a22c8cc62e30454b8ca7610d1b4bc6c) @@ -6,7 +6,7 @@ # system, based on the Next Scripting Framework (NSF). # # Copyright (C) 2010-2016 Gustaf Neumann -# Copyright (C) 2010-2014 Stefan Sobernig +# Copyright (C) 2010-2016 Stefan Sobernig # # Vienna University of Economics and Business # Institute of Information Systems and New Media @@ -47,7 +47,7 @@ namespace eval ::nsf::parameter {} ;# make pkg-indexer happy namespace eval ::nx::internal {} ;# make pkg-indexer happy - namespace eval ::nx::traits {} ;# make pkg-indexer happy + namespace eval ::nx::trait {} ;# make pkg-indexer happy # # By setting the variable bootstrap, we can check later, whether we @@ -2508,7 +2508,12 @@ # Evaluate the command under catch to ensure reverse mapping # of "new" # - set errorOccured [catch [list ::apply [list {} $cmds $object]] errorMsg] + if {[catch [list ::apply [list {} $cmds $object]] errorMsg]} { + set errorCode $::errorCode + set errorOccured 1 + } else { + set errorOccured 0 + } # # Remove the mapped "new" method, if it was added above @@ -2517,7 +2522,12 @@ if {[::nsf::is class ::xotcl::Class]} { if {$xotclMapNew} {::nsf::method::alias ::xotcl::Class new $plainNew} } - if {$errorOccured} {return -code error $errorMsg} + # + # Report the error with message and code when necessary + # + if {$errorOccured} { + return -code error -errorcode $errorCode $errorMsg + } } else { ::apply [list {} $cmds $object]