Menu

#154 incomplete return of errors inside the buffer/channel procs

Script Library
open
xmlgen (3)
5
2005-11-29
2005-11-29
No

If an error occurrs inside the body of the xmlgen procs
::xmlgen::buffer or ::xmlgen::channel, than the error
is catched, and "reraised", but with incomplete error
information.

In version 1.4, in the file "xmlgen.tcl", in line 128
an error is catched by:

set err [catch {uplevel 1 $body}]

But it should be ...

set err [catch {uplevel 1 $body} reason]

... to be able to "reraise" an error with its error
message.

The "reraise" of an error is done, in the same file in
line 138 by:

return -code error -errorinfo $::errorInfo

To "reraise" an error with all error related
information the error should be reraised by:

return -code error -errorinfo $::errorInfo
-errorcode $::errorCode $reason

The same changes are to be done in line 153 and 159.

After this a script really is able to report an error
raised inside the body of ::xmlgen::buffer and
::xmlgen::channel.

Discussion

  • Martin Lemburg

    Martin Lemburg - 2005-11-29

    Logged In: YES
    user_id=802134

    Missed to attached a patched file.

     
  • Martin Lemburg

    Martin Lemburg - 2005-11-29

    Patched xmlgen.tcl file for version 1.4

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.