Changeset 15140


Ignore:
Timestamp:
03/22/13 23:28:01 (12 years ago)
Author:
tbretz
Message:
Improved handling of exceptions coming from included files. This allows to catch exceptions from the included file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/InterpreterV8.cc

    r15139 r15140  
    697697        const bool rc = ExecuteFile(*file);
    698698        if (exception.HasCaught())
     699        {
     700            // If this is called from the main thread, re-throw
     701            if (fThreadId==V8::GetCurrentThreadId())
     702                return exception.ReThrow();
     703
     704            // Otherwise, handle the exception...
    699705            HandleException(exception, "include");
     706        }
    700707        if (!rc)
    701708        {
     709            // ...and stop the thread immediately (if this is not done,
     710            // the other threads might still proceed);
    702711            V8::TerminateExecution(fThreadId);
    703712            return ThrowException(Null());
     
    19901999    if (exception.HasCaught())
    19912000    {
    1992         if (file=="internal")
     2001        if (file=="internal" || (fThreadId==V8::GetCurrentThreadId() && !main))
    19932002            return exception.ReThrow();
    19942003
Note: See TracChangeset for help on using the changeset viewer.