Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 19, 2009, 11:17:51 PM (15 years ago)
Author:
rgrieder
Message:

Added Exception::handleMessage() (copy from Game::getExceptionMessage) function that returns the exception message (if retrievable) when catching with "…"
and adjusted some exception handlers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/TclBind.cc

    r5738 r5747  
    3535#include "SpecialConfig.h"
    3636#include "util/Debug.h"
     37#include "util/Exception.h"
    3738#include "util/StringUtils.h"
    3839#include "CommandExecutor.h"
     
    9293            catch (Tcl::tcl_error const &e)
    9394            {   COUT(1) << "Tcl error while creating Tcl-interpreter: " << e.what() << std::endl;   }
    94             catch (std::exception const &e)
    95             {   COUT(1) << "Error while creating Tcl-interpreter: " << e.what() << std::endl;   }
    9695            catch (...)
    97             {   COUT(1) << "Error while creating Tcl-interpreter." << std::endl;   }
     96            {   COUT(1) << "Error while creating Tcl-interpreter: " << Exception::handleMessage() << std::endl;   }
    9897        }
    9998    }
     
    115114        catch (Tcl::tcl_error const &e)
    116115        {   COUT(1) << "Tcl error while creating Tcl-interpreter: " << e.what() << std::endl; COUT(1) << "Error: Tcl isn't properly initialized. Orxonox might possibly not work like that." << std::endl;   }
    117         catch (std::exception const &e)
    118         {   COUT(1) << "Error while creating Tcl-interpreter: " << e.what() << std::endl; COUT(1) << "Error: Tcl isn't properly initialized. Orxonox might possibly not work like that." << std::endl;   }
    119116        catch (...)
    120         {   COUT(1) << "Error while creating Tcl-interpreter." << std::endl; COUT(1) << "Error: Tcl isn't properly initialized. Orxonox might possibly not work like that." << std::endl;   }
     117        {   COUT(1) << "Error while creating Tcl-interpreter: " << Exception::handleMessage() << std::endl; COUT(1) << "Error: Tcl isn't properly initialized. Orxonox might possibly not work like that." << std::endl;   }
    121118
    122119        return interpreter;
     
    178175            catch (Tcl::tcl_error const &e)
    179176            {   COUT(1) << "tcl> Error: " << e.what() << std::endl;   }
    180             catch (std::exception const &e)
    181             {   COUT(1) << "Error while executing Tcl: " << e.what() << std::endl;   }
     177            catch (...)
     178            {   COUT(1) << "Error while executing Tcl: " << Exception::handleMessage() << std::endl;   }
    182179        }
    183180
     
    199196        catch (Tcl::tcl_error const &e)
    200197        {   COUT(1) << "Tcl error: " << e.what() << std::endl;   }
    201         catch (std::exception const &e)
    202         {   COUT(1) << "Error while executing Tcl: " << e.what() << std::endl;   }
     198        catch (...)
     199        {   COUT(1) << "Error while executing Tcl: " << Exception::handleMessage() << std::endl;   }
    203200
    204201        return false;
Note: See TracChangeset for help on using the changeset viewer.