Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f8daa07e09d4bbba45e2f6df8733db5257c99a13
Ticket: 3104471fffffffffffffffffffffffffffffffff
"command returned bad code: 2" in bgerror
User & Date: kennykb on 2010-11-08 07:04:06
Changes

  1. assignee changed to: "dgp"
  2. icomment:
    Hmmm.
    
    From the symptoms, it appears as if something inside the [try] block is doing a 'return -code return' or 'return -level' all the way out to the event loop, causing the "invalid return code 2" (2 is TCL_RETURN).
    
    Since return code 2 isn't an error, ::errorInfo doesn't get set, so it contains whatever error information was pertinent to the last catch - in this case the one in init.tcl.  So the stack trace is bogus, but there's no other stack information to report (the return was successful, it's just that it's asking the event loop to return, and the event loop has nowhere to return *to.*
    
    It's arguable that errorInfo should be suppressed in this case, or perhaps whatever is reporting the invalid return code should gen something up to report what callout it had made that returned inappropriately. In any case, by manipulating the try/catch/finally, you've found what call it was: what remains is to find out why it's doing [return] when it isn't in a proc.
    
    I'm forwarding this one to dgp, because TclDefaultBgErrorCmd appears to be his, and he may have more insight into how to get a less confusing message out of all this.
    
    
  3. login: "kennykb"
  4. mimetype: "text/plain"
  5. subsystem changed to: "01. Notifier"
  6. username: "kennykb"