Catch Exception instead of Throwable for all but LuaThread run loop

This commit is contained in:
James Roseborough
2012-01-25 03:58:33 +00:00
parent 9922cbb3db
commit 3506930278
6 changed files with 16 additions and 16 deletions

View File

@@ -286,8 +286,8 @@ public class DebugLib extends VarArgFunction {
} finally {
ds.popInfo(n);
}
} catch ( Throwable t ) {
t.printStackTrace();
} catch ( Exception e ) {
e.printStackTrace();
} finally {
inhook = false;
}
@@ -302,7 +302,7 @@ public class DebugLib extends VarArgFunction {
DebugInfo getDebugInfo() {
try {
return debugInfo[debugCalls-1];
} catch ( Throwable t ) {
} catch ( Exception e ) {
if ( debugCalls <= 0 )
return debugInfo[debugCalls++] = new DebugInfo();
return null;

View File

@@ -196,8 +196,8 @@ public class lua {
}
Varargs scriptargs = (args!=null? setGlobalArg(args, firstarg): LuaValue.NONE);
c.invoke( scriptargs );
} catch ( Throwable t ) {
t.printStackTrace( System.err );
} catch ( Exception e ) {
e.printStackTrace( System.err );
}
}

View File

@@ -206,8 +206,8 @@ public class lua2java {
pw.close();
out.close();
in.close();
} catch ( Throwable t ) {
t.printStackTrace( System.err );
} catch ( Exception e ) {
e.printStackTrace( System.err );
}
}
}

View File

@@ -172,8 +172,8 @@ public class luac {
DumpState.dump(chunk, out, stripdebug, numberformat, littleendian);
}
} catch ( Throwable t ) {
t.printStackTrace( System.err );
} catch ( Exception e ) {
e.printStackTrace( System.err );
} finally {
script.close();
}

View File

@@ -228,17 +228,17 @@ public class luajc {
Object o = c.newInstance();
if ( verbose )
System.out.println(" loaded "+classname+" as "+o );
} catch ( Throwable th ) {
} catch ( Exception ex ) {
System.out.flush();
System.err.println(" failed to load "+classname+": "+th );
System.err.println(" failed to load "+classname+": "+ex );
System.err.flush();
}
}
}
} catch ( Throwable t ) {
System.err.println(" failed to load "+inf.srcfilename+": "+t );
t.printStackTrace( System.err );
} catch ( Exception e ) {
System.err.println(" failed to load "+inf.srcfilename+": "+e );
e.printStackTrace( System.err );
System.err.flush();
}
}

View File

@@ -189,8 +189,8 @@ public class LuaScriptEngine implements ScriptEngine, Compilable {
} finally {
ris.close();
}
} catch ( Throwable t ) {
throw new ScriptException("eval threw "+t.toString());
} catch ( Exception e ) {
throw new ScriptException("eval threw "+e.toString());
}
}