Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 28, 2008, 6:45:02 PM (16 years ago)
Author:
landauf
Message:

fixed tcl initialisation bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/core/TclBind.cc

    r1446 r1454  
    133133    std::string TclBind::tcl(const std::string& tclcode)
    134134    {
    135         try
     135        if (TclBind::getInstance().interpreter_)
    136136        {
    137             std::string output = TclBind::getInstance().interpreter_->eval(tclcode);
    138             if (output != "")
     137            try
    139138            {
    140                 COUT(0) << "tcl> " << output << std::endl;
     139                std::string output = TclBind::getInstance().interpreter_->eval(tclcode);
     140                if (output != "")
     141                {
     142                    COUT(0) << "tcl> " << output << std::endl;
     143                }
     144                return output;
    141145            }
    142             return output;
     146            catch (Tcl::tcl_error const &e)
     147            {   COUT(1) << "tcl> Error: " << e.what() << std::endl;   }
     148            catch (std::exception const &e)
     149            {   COUT(1) << "Error while executing Tcl: " << e.what() << std::endl;   }
    143150        }
    144         catch (Tcl::tcl_error const &e)
    145         {   COUT(1) << "tcl> Error: " << e.what() << std::endl;   }
    146         catch (std::exception const &e)
    147         {   COUT(1) << "Error while executing Tcl: " << e.what() << std::endl;   }
    148151
    149152        return "";
Note: See TracChangeset for help on using the changeset viewer.