title: How can I check that Tcl command didn't throw an exception or error?
body: <p>I have a following procedure:</p>
  
  <pre><code>proc myexec { args } {
      info_msg "Executing shell command: $args"
  
      set catch_res [catch  {eval exec $args} res]
  
      if { $catch_res != 0 } {
          error_msg "Failed in command: $args"
          error_msg "$res"
      }
  
      return $catch_res
  }
  </code></pre>
  
  <p>It only checks Unix commands and doesn't work with Tcl commands.
  How can I change this procedure so that it will work with Tcl commands?</p>
  
  <p>For example, if I want to check that the following commands evaluate without error:</p>
  
  <pre><code>set object1 $object2
  </code></pre>
  
  <p>or </p>
  
  <pre><code>open $filename r
  </code></pre>